Skip to content

Number Formatting issue #383

@masterboltdev

Description

@masterboltdev

Found a small issue when combining text with currency number formatting. (I'm US) It added the decimal, comma and $ but if the argument variable didnt have 2 decimal places, it returned 1. For example: 1.7 should be $1.70. Returns as $1.7. I believe the reason is that you left the call to simpleCurrency() out - only calling NumberFormat().

I'm using this as a custom function as a workaround.

String formatAsCurrency(double amt) {
final formatCurrency = new NumberFormat.simpleCurrency();
return formatCurrency.format(amt);
}

Metadata

Metadata

Labels

status: confirmedIssue has been reproduced and confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions