Fixed-Point Number Functions
Fixed-Point numbers have multiple built-in functions you can use.
fun toString(): String
Returns the string representation of the fixed-point number.
let fix = 1.23
fix.toString() // is "1.23000000"
-
fun toBigEndianBytes(): [UInt8]
Returns the byte array representation ([UInt8]
) in big-endian order of the fixed-point number.
let fix = 1.23
fix.toBigEndianBytes() // is `[0, 0, 0, 0, 7, 84, 212, 192]`
Last updated
Was this helpful?