Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Teams
, (opens new window)

Power Scripts for Jira Cloud
Results will update as you type.
  • Configuration guides
  • Integration guides
  • Feature guides
  • Advanced features
  • Migration resources
  • Simple Issue Language
    • Getting started with SIL
    • SIL reference guide
    • SIL Functions library
      • Function Index
      • Packages
      • Array Functions
      • Basic Functions
      • Date and Interval Functions
      • Excel Functions
      • File Manipulation Functions
      • HTTP Functions
      • Incoming Mail Processing Functions
      • Integration with Other Systems
      • Jira Administration Functions
      • Jira Integration Functions
      • Jira Service Management Functions
      • Jira Software Functions
      • Listener Functions
      • Math Functions
        • abs
        • bitwise_and
        • bitwise_lshift
        • bitwise_not
        • bitwise_or
        • bitwise_rshift
        • bitwise_rushift
        • bitwise_xor
        • ceiling
        • cos
        • degrees
        • e number
        • exp
        • fact
        • floor
        • formatNumber
        • ln
        • log
        • pi
        • power
        • radians
        • rand
        • random
        • roman
        • round
        • sign
        • sin
        • sqrt
        • tan
        • trunc
      • Parameter Functions
      • Scheduling Functions
      • String Functions
      • System Integration
      • Webhooks Functions
  • Tutorials and recipes
  • Jira Product Discovery support
  • Release notes
  • Help and support
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    formatNumber
    Updated Nov 19, 2024

    formatNumber

    Description

    Formats a number according to a format string.

    Parameters

    Return Type

    String

    Example

    string a = formatNumber(123456.789 ,"###,###.###"); //The pound sign (#) denotes a digit, the comma is a placeholder for the grouping separator, and the period is a placeholder for the decimal separator. print("a= " + a); string b = formatNumber(12345.67, "$###,###.###"); print("b= " + b); string c = formatNumber(123.78, "000000.000"); //The format specifies leading and trailing zeros, because the 0 character is used instead of the pound sign (#). print("c= " + c); string d = formatNumber(123456.789, "###.##"); // The number has three digits to the right of the decimal point, but the format has only two. The format method handles this by rounding up. print("d=" + d);

    Prints:

    a= 123,456.789

    b = $12,345.67

    c= 000123.780

    d=123456.79

    The symbols are described in the following table:

    Symbol

    Description

    Symbol

    Description

    0

    a digit

    #

    a digit, zero shows as absent

    .

    placeholder for decimal separator

    ,

    placeholder for grouping separator

    E

    separates mantissa and exponent for exponential formats

    ;

    separates formats

    -

    default negative prefix

    %

    multiply by 100 and show as percentage

    ?

    multiply by 1000 and show as per mille

    $

    currency sign; replaced by currency symbol; if doubled, replaced by international currency symbol; if present in a pattern, the monetary decimal separator is used instead of the decimal separator

    X

    any other characters can be used in the prefix or suffix

    '

    used to quote special characters in a prefix or suffix

    See also

    • Page:
      bitwise_or
    • Page:
      sqrt
    • Page:
      e number
    • Page:
      fact
    • Page:
      radians
    • Page:
      bitwise_rushift
    • Page:
      degrees
    • Page:
      bitwise_xor
    • Page:
      ln
    • Page:
      floor
    • Page:
      abs
    • Page:
      tan
    • Page:
      bitwise_rshift
    • Page:
      trunc
    • Page:
      formatNumber
    • Page:
      exp
    • Page:
      bitwise_lshift
    • Page:
      power
    • Page:
      bitwise_not
    • Page:
      round
    • Page:
      random
    • Page:
      pi
    • Page:
      ceiling
    • Page:
      roman
    • Page:
      cos
    Peacock

    Need support? Create a request with our support team.

    Copyright © 2005 - 2025 Appfire | All rights reserved.

    {"serverDuration": 14, "requestCorrelationId": "478ea984b0af45aa9db317629201a597"}