#1 Yesterday 18:53:00

rdevine
Member
Registered: 2014-02-20
Posts: 56

Currency to text on server

I'm displaying currency values in a browser table (AG Grid in a Javascript client) and of course the displayed values are multiplied by 10000, so I'll need to convert on the server before populating the JSON. I can see that I can get access to the Orm properties in the FillOne loop, but I wondered if there's a better way to convert the currency fields to utf8 on-the-fly.

Thanks, Bob

Offline

#2 Yesterday 19:35:19

rdevine
Member
Registered: 2014-02-20
Posts: 56

Re: Currency to text on server

Actually, turns out to be easy to format the AG Grid fields - that works fine. So, really just curiosity now :-)

Offline

#3 Yesterday 20:27:32

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,085
Website

Re: Currency to text on server

Currency property values should be written in JSON with proper decimals by the framework.

I don't really understand your problem here...

Offline

#4 Yesterday 21:51:58

rdevine
Member
Registered: 2014-02-20
Posts: 56

Re: Currency to text on server

Sorry - I see what's happening now. The AG Grid is getting a JSArray of JSValue so there's no way for it to recognise a currency field type and do the conversion. The values in the grid are therefore multiplied by 10000. I'll need to use a custom formatter in the grid.

Thanks, Bob

Offline

Board footer

Powered by FluxBB