diff --git a/src/helpers/toMaxAllowedDecimalsNumberString.spec.ts b/src/helpers/toMaxAllowedDecimalsNumberString.spec.ts index 9bcc0c39..4ff06e85 100644 --- a/src/helpers/toMaxAllowedDecimalsNumberString.spec.ts +++ b/src/helpers/toMaxAllowedDecimalsNumberString.spec.ts @@ -14,19 +14,10 @@ describe("toMaxAllowedDecimalsNumberString", () => { it("should not round number string when it has less decimals than the max allowed", () => { const result1 = toMaxAllowedDecimalsNumberString("0.0004", 6); const result2 = toMaxAllowedDecimalsNumberString(".00004", 6); + const result3 = toMaxAllowedDecimalsNumberString("1.343434344334", 6); expect(result1).toBe("0.0004"); expect(result2).toBe(".00004"); - }); - - it("should not try to round numbers bigger than 1", () => { - const result1 = toMaxAllowedDecimalsNumberString("1.343434344334", 6); - const result2 = toMaxAllowedDecimalsNumberString( - "999999999999999999.9999999999999", - 6 - ); - - expect(result1).toBe("1.343434344334"); - expect(result2).toBe("999999999999999999.9999999999999"); + expect(result3).toBe("1.343434"); }); }); diff --git a/src/helpers/toMaxAllowedDecimalsNumberString.ts b/src/helpers/toMaxAllowedDecimalsNumberString.ts index 745771e5..747be590 100644 --- a/src/helpers/toMaxAllowedDecimalsNumberString.ts +++ b/src/helpers/toMaxAllowedDecimalsNumberString.ts @@ -14,10 +14,6 @@ const toMaxAllowedDecimalsNumberString = ( ); const firstCharacterIsPeriod = firstCharacter === "."; - if (firstCharacterIsNonZero) { - return value; - } - if ( value === "" || value === "." ||