Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
Stay organized with collections
Save and categorize content based on your preferences.
Convert a number to a string using printf-style formatting.
Usage
Returns
Number.format(pattern)
String
Argument
Type
Details
this: number
Number
The number to convert to a string.
pattern
String, default: "%s"
A printf-style format string. For example, '%.2f' produces numbers formatted like '3.14', and '%05d' produces numbers formatted like '00042'. The format string must satisfy the following criteria:
Zero or more prefix characters.
Exactly one '%'.
Zero or more modifier characters in the set [#-+ 0,(.\d].
Exactly one conversion character in the set [sdoxXeEfgGaA].
Zero or more suffix characters.
For more about format strings, see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Formatter.html
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-19 UTC."],[[["`Number.format()` converts Earth Engine Numbers to strings using printf-style formatting."],["The `pattern` argument accepts a format string, like '%.2f' for 2 decimal places or '%03d' for zero-padding to 3 digits."],["This function allows customization of numeric output for display or further processing within Earth Engine scripts."],["Refer to the Java Formatter documentation for details on available format string options and syntax."]]],[]]