NumberFormat rounding decimal places differently

This one is very odd, but I am guessing there is a basic explanation.

  1. NumberFormat(49.995,‘_.__’ ) gives me “50”… which is what I would expect.

  2. NumberFormat( 214.995, ‘_.__’ ) should give me 215, but it does not, it give me “214.99”

Scenario 1 appears to be rounding the decimal places, while Scenario 2 appears to just be truncating.

Does anyone have any idea what is going on here? Is it a bug, or am I missing something?

Many Thanks

Jason

windows server 2019 ,Lucee 5.3.10.120

I have the same problem here !

set amount=‘237453.525’

#numberformat(amount,'0.00')# | #decimalformat(amount)#

result :
237453.52 | 237,453.53

Can someone reply this issue please

@zuwari created a new ticket for this issue in JIRA: [LDEV-4439] - Lucee

1 Like

Will this be resolved on Lucee 5.4.0.80 ?

nope, but i have flagged this as breaking change for 6

Hi Zack , well i have some free time yesterday, so I attempted to test this issue with Lucee6. Unfortunately, it seems that the problem is still persisting. Would you mind taking a look at this matter?

From the Jira ticket I can see it’s marked as “Waiting for approval”. That means the patch still needs to be reviewed and deployed. But you could try to add the patch to a forked source version yourself and create an own Lucee.jar build to try it out (or patch your own Lucee.jar) in case it is extremly important.

there is no patch yet, only a test case has been added.

@micstriit will review and action the ticket, however, we have other higher priority tickets before this one

1 Like

@Zackster what does “Awaiting for Approval” mean? Is it an “waiting ok to be deployed”, or more a “waiting ok to be accepted as an issue”?

The later, it’s the step before backlog in our work flow.

I believe Patch ready is fairly clear as a status :wink:

1 Like