GlideNumberFormatter – format(Number number)

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 1 minute to read
  • Provides a string representation of a number formatted according to the language setting of the current user.

    Table 1. Parameters
    Name Type Description
    number Number Number of any size.
    Table 2. Returns
    Type Description
    String Number formatted according to the language setting of the current user.

    The following example shows the output for a user with language set to Spanish.

    gs.info("Number is: " + sn_i18n.NumberFormatter.format(123456.789));
    gs.info("Number is: " + sn_i18n.NumberFormatter.format(-123456.789));

    Output:

    Number is: 123.456,789
    Number is: -123.456,789