Skip to content

Commit 72ff506

Browse files
committed
Test negative values in americal notation
1 parent 0672a45 commit 72ff506

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/math/src/decimal.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ describe("Decimal", () => {
194194
expect(Decimal.fromUserInput(".1", 3).atomics).toEqual("100");
195195
expect(Decimal.fromUserInput(".12", 3).atomics).toEqual("120");
196196
expect(Decimal.fromUserInput(".123", 3).atomics).toEqual("123");
197+
198+
// ⬇️ strange style but JavaScript supports it too 🤷‍♂️
199+
expect(Decimal.fromUserInput("-.1", 3).atomics).toEqual("-100");
200+
expect(Decimal.fromUserInput("-.12", 3).atomics).toEqual("-120");
201+
expect(Decimal.fromUserInput("-.123", 3).atomics).toEqual("-123");
197202
});
198203
});
199204

0 commit comments

Comments
 (0)