plow-technologies / inferno

A statically-typed functional scripting language
MIT License
4 stars 1 forks source link

[inferno-core] Added `toBCD` and `fromBCD` to Prelude #42

Closed LTibbetts closed 1 year ago

LTibbetts commented 1 year ago

Example script:

let d = Option.reduce id 0.0 (latestValue input0)
in let oBCD = fromBCD (toWord64 (round d))
in match oBCD with {
| None -> toWord64 0
| Some x -> x
}