TIL: Workday Studio Decimal Formatting
Today I was trying to clean up the log message for a number and wanted to add some formatting to the decimal to add 0 padding so 2 becomes 0002 or 2345 becomes 2,345.
Add zero padding¶
Java
props["count"] = 23;
props["fmt"] = new java.text.DecimalFormat("00000");
props["fmt"].format(props["count"]);
// result: '00023'
Add thousands separator¶
This seems like a really roundabout way... but it worked...