fix(input-amount): use minus sign unicode instead of hypen-minus

This commit is contained in:
Joren Broekema 2019-09-19 16:01:20 +02:00
parent 85beb18e26
commit edd7396e15
2 changed files with 3 additions and 7 deletions

View file

@ -60,7 +60,7 @@ describe('formatAmount()', () => {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
).to.equal('-12.35');
).to.equal('12.35');
});
it('formats the right amount of fraction digits for a certain currency', async () => {

View file

@ -29,12 +29,8 @@ export function formatNumberToParts(number, options) {
const regexSymbol = /[A-Z.,\s0-9]/;
const regexCode = /[A-Z]/;
/**
* TODO: Preprocessor should convert other "dashes" unicodes to −
* 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
// U+002D, Hyphen-Minus, -
const regexMinusSign = /[-]/;
const regexNum = /[0-9]/;
const regexSeparator = /[.,]/;