diff --git a/packages/math/src/decimal.spec.ts b/packages/math/src/decimal.spec.ts index 6f077075..e8f70330 100644 --- a/packages/math/src/decimal.spec.ts +++ b/packages/math/src/decimal.spec.ts @@ -33,7 +33,9 @@ describe("Decimal", () => { }); it("throws for atomics that are not non-negative integers", () => { - expect(() => Decimal.fromAtomics("-1", 0)).toThrowError(/atomics must not be negative/i); + expect(() => Decimal.fromAtomics("-1", 0)).toThrowError( + /invalid string format. Only non-negative integers in decimal representation supported/i, + ); }); }); diff --git a/packages/math/src/decimal.ts b/packages/math/src/decimal.ts index 0aac60ce..0a6a798b 100644 --- a/packages/math/src/decimal.ts +++ b/packages/math/src/decimal.ts @@ -109,7 +109,7 @@ export class Decimal { private constructor(atomics: string, fractionalDigits: number) { if (!atomics.match(/^[0-9]+$/)) { throw new Error( - "Invalid string format. Only non-negative integers in decimal representation suppored.", + "Invalid string format. Only non-negative integers in decimal representation supported.", ); }