Locales broken or documentation on main page wrong.
See original GitHub issueLocales according to the documentation on the main page do not work:
>var numeral = require("numeral")
> numeral.locale('de')
'de'
> numeral("12.2000.0065,9812")
TypeError: Cannot read property 'delimiters' of undefined
at stringToNumber (/home/schultes/tpf/baenk-web/server/node_modules/numeral/numeral.js:284:27)
at numeral (/home/schultes/tpf/baenk-web/server/node_modules/numeral/numeral.js:84:25)
at repl:1:1
at ContextifyScript.Script.runInThisContext (vm.js:23:33)
at REPLServer.defaultEval (repl.js:339:29)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
at REPLServer.onLine (repl.js:536:10)
at emitOne (events.js:101:20)
at REPLServer.emit (events.js:191:7)
While this works:
>var numeral = require("numeral")
> var de = require('numeral/locales/de')
undefined
> numeral.locale('de')
'de'
> numeral("12.2000.0065,9812")
{ _input: '12.2000.0065,9812', _value: 1220000065.9812 }
>
Does anyone know what the right way to use this is?
Actually I’m surprised this works at all, as the German locale is not correctly specified #533
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
How do I fix my locale issue? - Ask Ubuntu
First run locale to list what locales currently defined for the current user ... Then generate the missing locale and reconfigure locales to...
Read more >Open a document after a file corruption error - Microsoft Support
The Open and Repair command might be able to recover your file. Click File > Open > Browse and then go to the...
Read more >How to Fix the "There Has Been a Critical Error on Your ...
The quickest way to fix the problem is to roll back your website if you have a backup, but there are a variety...
Read more >Error 404: 4 Ways to Fix It - Hostinger
Ensure the domain points to the web host · Fix file permissions · Disable the broken .htaccess file · Restore the website backup...
Read more >locale — Internationalization services — Python 3.11.1 ...
Source code: Lib/locale.py The locale module opens access to the POSIX locale ... If the modification of the locale fails, the exception Error...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

For anyone just coming across this, simply import the necessary locales along with the library:
@linkb15 I don’t think this repository is under active maintenance.
Instead, consider using https://github.com/BenjaminVanRyseghem/numbro, which is a fork under active development. I don’t know if the locales are fixed though!