[
{ "name": "two fixed places", "args": [3.14159, 2, false, ""], "expect": "3.14" },
{ "name": "fixed places keep trailing zeros", "args": [2.5, 2, false, ""], "expect": "2.50" },
{ "name": "trimmed places drop trailing zeros", "args": [2.5, 2, true, ""], "expect": "2.5" },
{ "name": "a whole number trims to no point at all", "args": [7, 2, true, ""], "expect": "7" },
{ "name": "zero places", "args": [1234.5, 0, false, ""], "expect": "1235" },
{ "name": "thousands grouped with a comma", "args": [1234567.891, 2, false, ","], "expect": "1,234,567.89" },
{ "name": "grouping with a thin space, only in the whole part", "args": [12345.6789, 4, false, " "], "expect": "12 345.6789" },
{ "name": "exactly three digits get no separator", "args": [999, 0, false, ","], "expect": "999" },
{ "name": "a negative number", "args": [-1234.5, 1, false, ","], "expect": "-1,234.5" },
{ "name": "a negative that rounds to zero prints 0, not -0", "args": [-0.004, 2, false, ""], "expect": "0.00" },
{ "name": "a small number keeps its leading zeros, never 1e-7", "args": [0.0000001, 7, false, ""], "expect": "0.0000001" },
{ "name": "a large number is never 1e+21 style", "args": [123456789012, 0, false, ""], "expect": "123456789012" },
{ "name": "2.675 is stored below the tie, so 2.67 (as toFixed)", "args": [2.675, 2, false, ""], "expect": "2.67" },
{ "name": "0.125 is a true tie and goes away from zero", "args": [0.125, 2, false, ""], "expect": "0.13" },
{ "name": "binary noise disappears", "args": [0.30000000000000004, 12, true, ""], "expect": "0.3" },
{ "name": "fractional zero trims to 0", "args": [0, 3, true, ","], "expect": "0" },
{ "name": "rounding carries into a new group", "args": [999999.996, 2, false, ","], "expect": "1,000,000.00" },
{ "name": "too many digits for an exact count is an error", "args": [1e15, 0, false, ""], "expectError": "value is too large to format at 0 decimal places" },
{ "name": "more than 12 places is an error", "args": [1, 13, false, ""], "expectError": "decimals must be a whole number from 0 to 12" }
]