iwk #997(2007/07/16 10:31 GMT) [ OCaml ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14
open System;; open System.Text.RegularExpressions;; let yen:string = "円";; let tax str = let re = new Regex( "\d+" ^ yen ) in let matches = Seq.to_list { for m in re.Matches( str ) -> m.ToString() } in let getPrice (s:string) = Int32.Parse(s.Replace(yen, "")) in let taxes s = ((getPrice s) * 105 / 100).ToString() ^ yen in let rec replace (base:string) = function | [] -> base | m::ms -> replace (base.Replace(m,(taxes m))) ms in replace str matches;;
Rating0/0=0.00-0+
[ reply ]
iwk
#997()
[
OCaml
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]