bobril-g11n
Advanced tools
Comparing version 2.2.0 to 2.3.0
CHANGELOG | ||
=== | ||
2.3.0 | ||
-- | ||
Upgraded numeral version to 2.0.4 | ||
- | ||
2.2.0 | ||
@@ -5,0 +11,0 @@ -- |
{ | ||
"name": "bobril-g11n", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Bobril globalization", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"moment": "^2.10.6", | ||
"numeral": "^1.5.3" | ||
"numeral": "^2.0.4" | ||
}, | ||
@@ -23,2 +23,2 @@ "devDependencies": { | ||
"license": "MIT" | ||
} | ||
} |
@@ -14,12 +14,12 @@ import { RuntimeFunctionGenerator } from './RuntimeFunctionGenerator'; | ||
if (style === 'custom' && 'format' in options) { | ||
return (val, opt) => { numeral.language(language); return numeral(val).format((<any>opt).format); }; | ||
return (val, opt) => { numeral.locale(language); return numeral(val).format((<any>opt).format); }; | ||
} | ||
if (style === 'default') { | ||
return (val, _opt) => { numeral.language(language); return numeral(val).format('0,0.[0000]') }; | ||
return (val, _opt) => { numeral.locale(language); return numeral(val).format('0,0.[0000]') }; | ||
} | ||
if (style === 'percent') { | ||
return (val, _opt) => { numeral.language(language); return numeral(val).format('0%') }; | ||
return (val, _opt) => { numeral.locale(language); return numeral(val).format('0%') }; | ||
} | ||
if (style === 'bytes') { | ||
return (val, _opt) => { numeral.language(language); return numeral(val).format('0b') }; | ||
return (val, _opt) => { numeral.locale(language); return numeral(val).format('0b') }; | ||
} | ||
@@ -26,0 +26,0 @@ break; |
@@ -154,3 +154,3 @@ /// <reference path="../typings/moment/moment-node.d.ts" /> | ||
export function unformatNumber(str: string): number { | ||
return numeral().unformat(str); | ||
return numeral(str).value(); | ||
} | ||
@@ -157,0 +157,0 @@ |
Sorry, the diff of this file is not supported yet
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
174301
+ Addednumeral@2.0.6(transitive)
- Removednumeral@1.5.6(transitive)
Updatednumeral@^2.0.4