Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-11

WebData - Formatting ExtJSon fields

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author
to Leonardo M. Ramé
Leonardo M. Ram? wrote
Hi, I'm using WebData and I need to format some numbers as Currency before sending back from my app to the browser. How can I do that?

JSON doesn't know a currency type ? You want to do it as string ? There is an AfterRowToJSON event; You can take the currency members and convert them to string members:

AObject.strings['myfield']:=FormatCurrency(AObject.Floats['myfield']);

Michael.

Reply by email

Leonardo M. Ramé
to Unknown author
Show quoted text 14 lines
On Mon, 29 Nov 2010, Leonardo M. Ram? wrote: >Hi, I'm using WebData and I need to format some numbers as Currency >before sending back from my app to the browser. How can I do that? JSON doesn't know a currency type ? You want to do it as string ? There is an AfterRowToJSON event; You can take the currency members and convert them to string members: AObject.strings['myfield']:=FormatCurrency(AObject.Floats['myfield']); Michael.

Yes, that was I was looking for. Thanks!.

Reply by email