@lion/localize
Advanced tools
Comparing version 0.4.14 to 0.4.15
@@ -6,2 +6,14 @@ # Change Log | ||
## [0.4.15](https://github.com/ing-bank/lion/compare/@lion/localize@0.4.14...@lion/localize@0.4.15) (2019-09-20) | ||
### Bug Fixes | ||
* **input-amount:** use minus sign unicode instead of hypen-minus ([edd7396](https://github.com/ing-bank/lion/commit/edd7396)) | ||
* **localize:** use minus sign unicode instead of hypen-minus ([85beb18](https://github.com/ing-bank/lion/commit/85beb18)) | ||
## [0.4.14](https://github.com/ing-bank/lion/compare/@lion/localize@0.4.13...@lion/localize@0.4.14) (2019-08-23) | ||
@@ -8,0 +20,0 @@ |
{ | ||
"name": "@lion/localize", | ||
"version": "0.4.14", | ||
"version": "0.4.15", | ||
"description": "The localization system helps to manage localization data split into locales and automate its loading", | ||
@@ -45,3 +45,3 @@ "author": "ing-bank", | ||
}, | ||
"gitHead": "3c7f5ab3f07411077fa65c5c9c77ac0b00ead3b0" | ||
"gitHead": "5ad88b506c7bfc0994602d11dfe53a44b454e18e" | ||
} |
@@ -31,3 +31,6 @@ import { emptyStringWhenNumberNan } from './emptyStringWhenNumberNan.js'; | ||
const regexCode = /[A-Z]/; | ||
// U+002D, Hyphen-Minus, - | ||
const regexMinusSign = /[-]/; | ||
const regexNum = /[0-9]/; | ||
@@ -42,3 +45,3 @@ const regexSeparator = /[.,]/; | ||
if (regexMinusSign.test(formattedNumber[i])) { | ||
formattedParts.push({ type: 'minusSign', value: formattedNumber[i] }); | ||
formattedParts.push({ type: 'minusSign', value: '−' /* U+2212, 'Minus-Sign', − */ }); | ||
} | ||
@@ -45,0 +48,0 @@ // detect numbers |
@@ -30,4 +30,4 @@ import { expect } from '@open-wc/testing'; | ||
it('uses minus (and not dash) to indicate negative numbers ', () => { | ||
expect(formatNumber(-12, { style: 'decimal', maximumFractionDigits: 0 })).to.equal('-12'); | ||
it('uses minus U+2212 (and not dash) to indicate negative numbers ', () => { | ||
expect(formatNumber(-12, { style: 'decimal', maximumFractionDigits: 0 })).to.equal('−12'); | ||
}); | ||
@@ -39,4 +39,4 @@ | ||
expect(formatNumber(-12.4, { roundMode: 'round' })).to.equal('-12'); | ||
expect(formatNumber(-12.6, { roundMode: 'round' })).to.equal('-13'); | ||
expect(formatNumber(-12.4, { roundMode: 'round' })).to.equal('−12'); | ||
expect(formatNumber(-12.6, { roundMode: 'round' })).to.equal('−13'); | ||
}); | ||
@@ -48,4 +48,4 @@ | ||
expect(formatNumber(-12.4, { roundMode: 'ceiling' })).to.equal('-12'); | ||
expect(formatNumber(-12.6, { roundMode: 'ceiling' })).to.equal('-12'); | ||
expect(formatNumber(-12.4, { roundMode: 'ceiling' })).to.equal('−12'); | ||
expect(formatNumber(-12.6, { roundMode: 'ceiling' })).to.equal('−12'); | ||
}); | ||
@@ -57,4 +57,4 @@ | ||
expect(formatNumber(-12.4, { roundMode: 'floor' })).to.equal('-13'); | ||
expect(formatNumber(-12.6, { roundMode: 'floor' })).to.equal('-13'); | ||
expect(formatNumber(-12.4, { roundMode: 'floor' })).to.equal('−13'); | ||
expect(formatNumber(-12.6, { roundMode: 'floor' })).to.equal('−13'); | ||
}); | ||
@@ -61,0 +61,0 @@ |
@@ -13,3 +13,3 @@ import { expect } from '@open-wc/testing'; | ||
const l = v => ({ type: 'literal', value: v }); | ||
const m = { type: 'minusSign', value: '-' }; | ||
const m = { type: 'minusSign', value: '−' }; | ||
@@ -16,0 +16,0 @@ const stringifyParts = parts => parts.map(part => part.value).join(''); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
142252
2829