Skip to content

Commit edd7396

Browse files
author
Joren Broekema
committed
fix(input-amount): use minus sign unicode instead of hypen-minus
1 parent 85beb18 commit edd7396

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/input-amount/test/formatters.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('formatAmount()', () => {
6060
minimumFractionDigits: 2,
6161
maximumFractionDigits: 2,
6262
}),
63-
).to.equal('-12.35');
63+
).to.equal('12.35');
6464
});
6565

6666
it('formats the right amount of fraction digits for a certain currency', async () => {

packages/localize/src/number/formatNumberToParts.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ export function formatNumberToParts(number, options) {
2929
const regexSymbol = /[A-Z.,\s0-9]/;
3030
const regexCode = /[A-Z]/;
3131

32-
/**
33-
* TODO: Preprocessor should convert other "dashes" unicodes to −
34-
* Then our regex should test for −
35-
* See also https://www.deque.com/blog/dont-screen-readers-read-whats-screen-part-1-punctuation-typographic-symbols/
36-
*/
37-
const regexMinusSign = /[-]/; // U+002D, Hyphen-Minus, - is what we test on for now, since most keyboards give you this for dash
32+
// U+002D, Hyphen-Minus, -
33+
const regexMinusSign = /[-]/;
3834

3935
const regexNum = /[0-9]/;
4036
const regexSeparator = /[.,]/;

0 commit comments

Comments
 (0)