Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: wwjsonserializer

$
0
0
Re: wwjsonserializer
Web Connection
Re: wwjsonserializer
Apr. 22, 2013
12:41 pm
3RN0R6JC4Show this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Joy Tan

You can't since the code generically converts numbers using TRANSFORM(). There's no way to generically force a format string in there that would work for all scenarios (what if you wanted 4 decimals or none?).

And realistically this shouldn't matter because both in FoxPro and JavaScript 2 == 2.00. Anything that receives those values on the other hand will have to deal with the fact that JavaScript doesn't differentiate between an Int or a Double or decimal value.

+++ Rick ---



Hi Rick,

I have a case of this code not returning the correct decimals

lojson = createobject("wwjsonserializer")
lcjson = lojson.serialize("cursor:cr1")

numeric fields of $2.00 are being returned with just 2?

e.g. "p_sellsfor":2, should be "p_sellsfor":2.00

How do I tweak this for correct decimals?

Thanks,
Joy



Rick Strahl
West Wind Technologies


from Maui, Hawaii

Making waves on the Web


Viewing all articles
Browse latest Browse all 10393

Trending Articles