Feature/upgrade internationalized number to version 3.6.0 (#4112)
* Upgrade @internationalized/number to version 3.6.0 * Refactoring * Update changelog
This commit is contained in:
parent
618a918423
commit
801030ce64
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Upgraded `@internationalized/number` from version `3.5.2` to `3.6.0`
|
||||||
|
|
||||||
## 2.127.0 - 2024-12-08
|
## 2.127.0 - 2024-12-08
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -2,37 +2,37 @@ import { extractNumberFromString } from '@ghostfolio/common/helper';
|
|||||||
|
|
||||||
describe('Helper', () => {
|
describe('Helper', () => {
|
||||||
describe('Extract number from string', () => {
|
describe('Extract number from string', () => {
|
||||||
it('Get decimal number', async () => {
|
it('Get decimal number', () => {
|
||||||
expect(extractNumberFromString({ value: '999.99' })).toEqual(999.99);
|
expect(extractNumberFromString({ value: '999.99' })).toEqual(999.99);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Get decimal number (with spaces)', async () => {
|
it('Get decimal number (with spaces)', () => {
|
||||||
expect(extractNumberFromString({ value: ' 999.99 ' })).toEqual(999.99);
|
expect(extractNumberFromString({ value: ' 999.99 ' })).toEqual(999.99);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Get decimal number (with currency)', async () => {
|
it('Get decimal number (with currency)', () => {
|
||||||
expect(extractNumberFromString({ value: '999.99 CHF' })).toEqual(999.99);
|
expect(extractNumberFromString({ value: '999.99 CHF' })).toEqual(999.99);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Get decimal number (comma notation)', async () => {
|
it('Get decimal number (comma notation)', () => {
|
||||||
expect(
|
expect(
|
||||||
extractNumberFromString({ locale: 'de-DE', value: '999,99' })
|
extractNumberFromString({ locale: 'de-DE', value: '999,99' })
|
||||||
).toEqual(999.99);
|
).toEqual(999.99);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Get decimal number with group (dot notation)', async () => {
|
it('Get decimal number with group (dot notation)', () => {
|
||||||
expect(
|
expect(
|
||||||
extractNumberFromString({ locale: 'de-CH', value: '99’999.99' })
|
extractNumberFromString({ locale: 'de-CH', value: '99’999.99' })
|
||||||
).toEqual(99999.99);
|
).toEqual(99999.99);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Get decimal number with group (comma notation)', async () => {
|
it('Get decimal number with group (comma notation)', () => {
|
||||||
expect(
|
expect(
|
||||||
extractNumberFromString({ locale: 'de-DE', value: '99.999,99' })
|
extractNumberFromString({ locale: 'de-DE', value: '99.999,99' })
|
||||||
).toEqual(99999.99);
|
).toEqual(99999.99);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Not a number', async () => {
|
it('Not a number', () => {
|
||||||
expect(extractNumberFromString({ value: 'X' })).toEqual(NaN);
|
expect(extractNumberFromString({ value: 'X' })).toEqual(NaN);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
8
package-lock.json
generated
8
package-lock.json
generated
@ -28,7 +28,7 @@
|
|||||||
"@dfinity/identity": "0.15.7",
|
"@dfinity/identity": "0.15.7",
|
||||||
"@dfinity/principal": "0.15.7",
|
"@dfinity/principal": "0.15.7",
|
||||||
"@dinero.js/currencies": "2.0.0-alpha.8",
|
"@dinero.js/currencies": "2.0.0-alpha.8",
|
||||||
"@internationalized/number": "3.5.2",
|
"@internationalized/number": "3.6.0",
|
||||||
"@nestjs/bull": "10.0.1",
|
"@nestjs/bull": "10.0.1",
|
||||||
"@nestjs/cache-manager": "2.2.2",
|
"@nestjs/cache-manager": "2.2.2",
|
||||||
"@nestjs/common": "10.1.3",
|
"@nestjs/common": "10.1.3",
|
||||||
@ -4126,9 +4126,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@internationalized/number": {
|
"node_modules/@internationalized/number": {
|
||||||
"version": "3.5.2",
|
"version": "3.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@internationalized/number/-/number-3.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/@internationalized/number/-/number-3.6.0.tgz",
|
||||||
"integrity": "sha512-4FGHTi0rOEX1giSkt5MH4/te0eHBq3cvAYsfLlpguV6pzJAReXymiYpE5wPCqKqjkUO3PIsyvk+tBiIV1pZtbA==",
|
"integrity": "sha512-PtrRcJVy7nw++wn4W2OuePQQfTqDzfusSuY1QTtui4wa7r+rGVtR75pO8CyKvHvzyQYi3Q1uO5sY0AsB4e65Bw==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@swc/helpers": "^0.5.0"
|
"@swc/helpers": "^0.5.0"
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
"@dfinity/identity": "0.15.7",
|
"@dfinity/identity": "0.15.7",
|
||||||
"@dfinity/principal": "0.15.7",
|
"@dfinity/principal": "0.15.7",
|
||||||
"@dinero.js/currencies": "2.0.0-alpha.8",
|
"@dinero.js/currencies": "2.0.0-alpha.8",
|
||||||
"@internationalized/number": "3.5.2",
|
"@internationalized/number": "3.6.0",
|
||||||
"@nestjs/bull": "10.0.1",
|
"@nestjs/bull": "10.0.1",
|
||||||
"@nestjs/cache-manager": "2.2.2",
|
"@nestjs/cache-manager": "2.2.2",
|
||||||
"@nestjs/common": "10.1.3",
|
"@nestjs/common": "10.1.3",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user