Category Archives: JsWorld

Released JsWorld 2.8.1 for currency, numeric and date/time formatting in JavaScript

JsWorld

The JsWorld library for JavaScript formatting and parsing of date/times, numeric and currency amounts received a fresh update for 2014. Written entirely in JavaScript, JsWorld takes a novel approach by enabling data localisation to be performed inside the browser, offloading the web server and offering unmatched flexibility for real-time applications.

What’s in the new 2.8.1 release of JsWorld?

  • The locale definitions were updated with the latests languages, countries and currency data obtained from Unicode. JsWorld has now support for 475 locales, including many new language / country combinations. As always, the locale definitions are available in three different formats – as JavaScript include files, as JSON files for dynamic loading as well as Mozilla property files if you intend to integrate JsWorld in a Firefox add-on.
  • The unique numeric / currency / date/time formatting engine was fine tuned for even greater performance. The JavaScript code has been stable for two years now and there have been no reported bugs since then.

Check out our live JavaScript number / currency / date formatting demo or proceed to the quick start guide. Comments and feedback are welcome as always.

 

JsWorld 2.4.1 with automatic currency rounding

JsWorld iconToday saw the release of JsWorld 2.4.1, which remains the most comprehensive JavaScript library for localised formatting and parsing of numeric, monetary and date/time values in web applications. This is a minor update which introduces automatic rounding of formatted currency amounts.

Up to now the default behaviour was to leave the fraction part of the original input amount unchanged.

var lc = new jsworld.Locale(POSIX_LC.en_US);
var mf = new jsworld.MonetaryFormatter(lc);
alert(mf.format(1500.005));

Result:

$1,500.005

To enforce rounding and display to a certain precision the optional ".n" argument can be used, where n is the number of desired fraction digits.

alert(mf.format(1500.005, ".2"));

Result:

$1,500.01

Yesterday I received an email from a customer in the US from which it became apparent that the default non-rounding behaviour was not intuitive to developers. After some consideration I decided to patch the library code to round per default, based on the number of fraction digits for the selected currency. The optional “.n” facility remains the same.

So the above

alert(mf.format(1500.005));

will now instead result in

$1,500.01

The patched version is now available as JsWorld 2.4.1.

JsWorld roadmap for 2011

JsWorld iconHere is a quick roadmap for 2011 for JsWorld, the Javascript library for currency, numeric and date/time l10n:

The core logic and API are pretty solid and settled now. No planned changes.

The locale database is scheduled for a small update in summer. At present it is based on Unicode’s CLDR 1.9 which supports over 300 locales, 200 countries and 100 currencies. Earlier this year there was a minor 1.9.1 release, but the fixes introduced there have no effect on number, date/time and monetary formatting. According to the tentative schedule published on the Unicode page a new major 2.0 release is planned for the end of May. Once the new locale data arrives I’ll regenerate the JsWorld database and put the new version as 2.4.1 up.

Otherwise I’m pretty busy these days, attending to various events here in London and also bringing the final bits of the NimbusDS.com website together. Nimbus DS is my latest venture to provide developers and integrators with specialised directory service solutions for web and cloud applications. This will become the new home of the Json2Ldap gateway / proxy, as well as of the newer JsonSSO and AuthService products.

JsWorld 2.4

JsWorld iconThis is a notification of the release of JsWorld 2.4. The new version keeps the core library logic the same. The only updates are to the locale definitions which now match the latest country data released by the Unicode Consortium (CLDR 1.9 from 2010-12-01). The JavaScript library now supports numeric, currency and date/time formatting + parsing in 341 world locales. Click here to see the complete list of languages, countries and currencies included in JsWorld 2.4.

Existing license holders were notified where they can download the update for no additional charge. If you haven’t received your email or have any questions or comments about this update – get in touch with me.