Add Num.withoutDecimalPoint

This commit is contained in:
Fabian Schmalzried 2024-03-14 23:59:06 +01:00
parent 62cc19c64b
commit 9c664172dd
No known key found for this signature in database
GPG key ID: D691D5DA4CEF42E7
9 changed files with 25 additions and 4 deletions

View file

@ -150,6 +150,8 @@ interface Num
toF32Checked,
toF64,
toF64Checked,
withoutDecimalPoint,
# withDecimalPoint
]
imports [
Bool.{ Bool },
@ -1406,3 +1408,10 @@ toU64Checked : Int * -> Result U64 [OutOfBounds]
toU128Checked : Int * -> Result U128 [OutOfBounds]
toF32Checked : Num * -> Result F32 [OutOfBounds]
toF64Checked : Num * -> Result F64 [OutOfBounds]
## Turns a [Dec] into its [I128] representation, effectifely removing the decimal point.
withoutDecimalPoint : Dec -> I128
## Turns a [I128] into the coresponding [Dec], effectifely addoing the decimal point.
#withDecimalPoint : I128 -> Dec