Skip to content

Commit 591b8b2

Browse files
authored
rename number format function (#8136)
1 parent f88f7b0 commit 591b8b2

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

pkg/_pub_shared/test/format/number_format_test.dart

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,39 +31,39 @@ void main() {
3131
});
3232

3333
test('Significant digit 0-999', () {
34-
expect(computeWith3SignificantDigits(0), (value: '0', suffix: ''));
35-
expect(computeWith3SignificantDigits(1), (value: '1', suffix: ''));
36-
expect(computeWith3SignificantDigits(23), (value: '23', suffix: ''));
37-
expect(computeWith3SignificantDigits(999), (value: '999', suffix: ''));
34+
expect(formatWith3SignificantDigits(0), (value: '0', suffix: ''));
35+
expect(formatWith3SignificantDigits(1), (value: '1', suffix: ''));
36+
expect(formatWith3SignificantDigits(23), (value: '23', suffix: ''));
37+
expect(formatWith3SignificantDigits(999), (value: '999', suffix: ''));
3838
});
3939

4040
test('Significant digit 1000-999499', () {
41-
expect(computeWith3SignificantDigits(1000), (value: '1.00', suffix: 'k'));
42-
expect(computeWith3SignificantDigits(1049), (value: '1.05', suffix: 'k'));
43-
expect(computeWith3SignificantDigits(1051), (value: '1.05', suffix: 'k'));
44-
expect(computeWith3SignificantDigits(1100), (value: '1.10', suffix: 'k'));
45-
expect(computeWith3SignificantDigits(9500), (value: '9.50', suffix: 'k'));
46-
expect(computeWith3SignificantDigits(99500), (value: '99.5', suffix: 'k'));
47-
expect(computeWith3SignificantDigits(100490), (value: '100', suffix: 'k'));
48-
expect(computeWith3SignificantDigits(100500), (value: '101', suffix: 'k'));
49-
expect(computeWith3SignificantDigits(199500), (value: '200', suffix: 'k'));
50-
expect(computeWith3SignificantDigits(999499), (value: '999', suffix: 'k'));
41+
expect(formatWith3SignificantDigits(1000), (value: '1.00', suffix: 'k'));
42+
expect(formatWith3SignificantDigits(1049), (value: '1.05', suffix: 'k'));
43+
expect(formatWith3SignificantDigits(1051), (value: '1.05', suffix: 'k'));
44+
expect(formatWith3SignificantDigits(1100), (value: '1.10', suffix: 'k'));
45+
expect(formatWith3SignificantDigits(9500), (value: '9.50', suffix: 'k'));
46+
expect(formatWith3SignificantDigits(99500), (value: '99.5', suffix: 'k'));
47+
expect(formatWith3SignificantDigits(100490), (value: '100', suffix: 'k'));
48+
expect(formatWith3SignificantDigits(100500), (value: '101', suffix: 'k'));
49+
expect(formatWith3SignificantDigits(199500), (value: '200', suffix: 'k'));
50+
expect(formatWith3SignificantDigits(999499), (value: '999', suffix: 'k'));
5151
});
5252

5353
test('Significant digit 999500-100000000', () {
54-
expect(computeWith3SignificantDigits(999500), (value: '1.00', suffix: 'M'));
55-
expect(computeWith3SignificantDigits(999999), (value: '1.00', suffix: 'M'));
54+
expect(formatWith3SignificantDigits(999500), (value: '1.00', suffix: 'M'));
55+
expect(formatWith3SignificantDigits(999999), (value: '1.00', suffix: 'M'));
5656
expect(
57-
computeWith3SignificantDigits(900000000), (value: '900', suffix: 'M'));
57+
formatWith3SignificantDigits(900000000), (value: '900', suffix: 'M'));
5858
expect(
59-
computeWith3SignificantDigits(999500000), (value: '1.00', suffix: 'B'));
60-
expect(computeWith3SignificantDigits(1009450000),
61-
(value: '1.01', suffix: 'B'));
62-
expect(computeWith3SignificantDigits(1094599999),
63-
(value: '1.09', suffix: 'B'));
64-
expect(computeWith3SignificantDigits(1095000001),
65-
(value: '1.10', suffix: 'B'));
66-
expect(computeWith3SignificantDigits(19000000000),
59+
formatWith3SignificantDigits(999500000), (value: '1.00', suffix: 'B'));
60+
expect(
61+
formatWith3SignificantDigits(1009450000), (value: '1.01', suffix: 'B'));
62+
expect(
63+
formatWith3SignificantDigits(1094599999), (value: '1.09', suffix: 'B'));
64+
expect(
65+
formatWith3SignificantDigits(1095000001), (value: '1.10', suffix: 'B'));
66+
expect(formatWith3SignificantDigits(19000000000),
6767
(value: '19.0', suffix: 'B'));
6868
});
6969
}

0 commit comments

Comments
 (0)