Skip to content

Instantly share code, notes, and snippets.

@cohalz
Last active January 3, 2016 18:19
Show Gist options
  • Save cohalz/8501390 to your computer and use it in GitHub Desktop.
Save cohalz/8501390 to your computer and use it in GitHub Desktop.
let doll_of_yen yen =
let rate = 114.32 in
let doll = float_of_int(yen) /. rate in
if int_of_float(doll *. 1000.0) mod 10 < 5 then floor(doll*.100.0)/.100.0 else floor((doll+.0.01)*.100.0)/.100.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment