Bug with dollarFormat() with negative number

Either I’m doing something wrong or this seems to be a regression. I’ve tested in 5.3.8 and 5.3.9 and I get the following output:

writedump(dollarFormat(-4.5)) : “-$4.50”

In ACF and in the Lucee docs (DollarFormat() :: Lucee Documentation) I see the following behavior:

writedump(dollarFormat(-4.5)) : “($4.50)”

My workaround for now is using my own function. numberFormat almost works but it puts the $ outside the parens.

public string function dollarFormat2(numeric number) {
    formatted = numberFormat(ARGUMENTS.number,'($,0.00)');
    return replace(formatted, '$(', '($');
}

@tsoslow This happens in lucee with java 11
The ticket for the issue in Jira: [LDEV-3743] - Lucee

2 Likes

Thank you! I should have searched jira for an issue first.