fix(input-amount): use minus sign unicode instead of hypen-minus
This commit is contained in:
parent
85beb18e26
commit
edd7396e15
2 changed files with 3 additions and 7 deletions
|
|
@ -60,7 +60,7 @@ describe('formatAmount()', () => {
|
||||||
minimumFractionDigits: 2,
|
minimumFractionDigits: 2,
|
||||||
maximumFractionDigits: 2,
|
maximumFractionDigits: 2,
|
||||||
}),
|
}),
|
||||||
).to.equal('-12.35');
|
).to.equal('−12.35');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('formats the right amount of fraction digits for a certain currency', async () => {
|
it('formats the right amount of fraction digits for a certain currency', async () => {
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,8 @@ export function formatNumberToParts(number, options) {
|
||||||
const regexSymbol = /[A-Z.,\s0-9]/;
|
const regexSymbol = /[A-Z.,\s0-9]/;
|
||||||
const regexCode = /[A-Z]/;
|
const regexCode = /[A-Z]/;
|
||||||
|
|
||||||
/**
|
// U+002D, Hyphen-Minus, -
|
||||||
* TODO: Preprocessor should convert other "dashes" unicodes to −
|
const regexMinusSign = /[-]/;
|
||||||
* Then our regex should test for −
|
|
||||||
* See also https://www.deque.com/blog/dont-screen-readers-read-whats-screen-part-1-punctuation-typographic-symbols/
|
|
||||||
*/
|
|
||||||
const regexMinusSign = /[-]/; // U+002D, Hyphen-Minus, - is what we test on for now, since most keyboards give you this for dash
|
|
||||||
|
|
||||||
const regexNum = /[0-9]/;
|
const regexNum = /[0-9]/;
|
||||||
const regexSeparator = /[.,]/;
|
const regexSeparator = /[.,]/;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue