API Reference › Decimal › Decimal.parse
method

Decimal.parse

Decimal.parse(text) -> Decimal

Parses text like "19.99" or "0.10" into an exact Decimal, remembering how many digits followed the point. This is how you enter a price the way binary floating point never could.

Example

program Demo {
  handler Step phase Update {
    let price = Decimal.parse("19.99")
  }
}
← All symbols