[Lazarus] WebData - Formatting ExtJSon fields
Leonardo M. Ramé
l.rame at griensu.com
Tue Nov 30 12:40:40 CET 2010
On 2010-11-30 09:32:24 +0100, michael.vancanneyt at wisa.be wrote:
>
>
> 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!.
--
Leonardo M. Ramé
http://leonardorame.blogspot.com
More information about the Lazarus
mailing list