RocDec::from_str accept 'e' exponent notation

The intent of this change is to allow roc dec values to be parsed from
strings using the 'e' exponent notation, eg '1e3' as a notation for '1000'.

Fixes #7351
This commit is contained in:
shua 2024-12-25 00:33:43 -05:00
parent 57cab7f69a
commit b5ce935d89
No known key found for this signature in database
2 changed files with 71 additions and 65 deletions

View file

@ -40,6 +40,11 @@ fn literal_4point2() {
expect_success("4.2", "4.2 : Frac *");
}
#[test]
fn literal_4point2e3() {
expect_success("4.2e3", "4200 : Frac *");
}
#[test]
fn num_addition() {
expect_success("1 + 2", "3 : Num *");