Comment detail

税込み価格への修正 (Nested Flatten)

	
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fun includeTax str =
let
  val s = tokens "[0-9]+" str
  val yen = tokens "[^0-9]+" str
  val tax = map (fn x => itoa (atoi x * 105 div 100)) yen

  fun loop (a::a', b::[]) = a ^ b ^ (concat a')
    | loop (a::a', b::b') = a ^ b ^ (loop (a', b'))
in
  loop (s, tax)
end

Index

Feed

Other

Link

Pathtraq

loading...