Migrate to a monorepo structure (#2909)

This commit is contained in:
Charles Bochet
2023-12-10 18:10:54 +01:00
committed by GitHub
parent a70a9281eb
commit 5bdca9de6c
2304 changed files with 37152 additions and 25869 deletions

View File

@ -0,0 +1,17 @@
import { formatNumber } from '../number';
// This tests the en-US locale by default
describe('formatNumber', () => {
it(`Should format 123 correctly`, () => {
expect(formatNumber(123)).toEqual('123');
});
it(`Should format decimal numbers correctly`, () => {
expect(formatNumber(123.92)).toEqual('123.92');
});
it(`Should format large numbers correctly`, () => {
expect(formatNumber(1234567)).toEqual('1,234,567');
});
it(`Should format large numbers with a decimal point correctly`, () => {
expect(formatNumber(7654321.89)).toEqual('7,654,321.89');
});
});

View File

@ -0,0 +1 @@
export const formatNumber = (value: number): string => value.toLocaleString();