Get started with globalize CDN

MIT licensed

Globalize JS: Easy date, number, and text formatting/parsing for diverse cultures.

Tags:
  • utility
  • globalization
  • internationalization
  • multilingualization
  • localization
  • g11n
  • i18n
  • m17n
  • L10n
  • localize
  • format
  • parse
  • translate
  • strings
  • numbers
  • dates
  • times
  • calendars
  • cultures
  • languages
  • locales

Stable version

Copied!

How to start using globalize CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with globalize CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/globalize/1.7.0/globalize.min.js"></script>
  <script src="https://cdn.cdnhub.io/globalize/1.7.0/locale/globalize.culture.js"></script>
</head>
<body>
  <script>
    // Initialize Globalize with the default culture 'en'
    Globalize.locale('en');

    // Define a custom number format
    Globalize.formatNumber('customCurrency', { style: 'currency', currency: 'USD' });

    // Format a number using the custom currency format
    const number = 12345.67;
    const formattedNumber = Globalize.formatNumber(number, 'customCurrency');

    console.log(formattedNumber); // Output: $12,345.67
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions