Logo

Programming-Idioms

  • Erlang
  • Rust

Idiom #192 Declare a real variable with at least 20 digits

Declare a real variable a with at least 20 digits; if the type does not exist, issue an error at compile time.

use rust_decimal::Decimal;
use std::str::FromStr;
let a = Decimal::from_str("1234567890.123456789012345").unwrap();
(def a 1234567890.12345678901M)

java.math.BigDecimal

New implementation...
< >
tkoenig