Loading ...
Sorry, an error occurred while loading the content.

Hello - question on JSON data types

Expand Messages
  • ljmiller8649
    I m new to JSON and want to format a number (e.g., 73.50) as a financial number. The float data type treats the number as 73.5 and drops the trailing zero.
    Message 1 of 3 , Jan 11, 2007
    • 0 Attachment
      I'm new to JSON and want to format a number (e.g., 73.50) as a
      financial number. The "float" data type treats the number as 73.5 and
      drops the trailing zero. My declaration is:

      {"title":"$Sales","dataType":"float", "columnWidth":"80"} ... etc.
      with
      {"v":73.50} ... as the incoming data

      I've heard about ways to extend the base data types but this is
      probably beyond my current abilities - and I'm looking for the
      simplest answers. Is there an easy way to handle this without too many
      extensions of the base data types ? Since the end-goal is financial
      data, is here a way to build a currency symbol into the data type ?

      thanks in advance for any help.

      regards,
      Lance
    • Douglas Crockford
      ... This isn t a JSON question. It is a JavaScript question. n.toFixed(2)
      Message 2 of 3 , Jan 11, 2007
      • 0 Attachment
        > I'm new to JSON and want to format a number (e.g., 73.50) as a
        > financial number. The "float" data type treats the number as 73.5 and
        > drops the trailing zero.

        This isn't a JSON question. It is a JavaScript question.

        n.toFixed(2)
      • Mark Ireland
        Are people on this list checking out Adobes Spry? (I ask because it seems to use json.data.recordSets)
        Message 3 of 3 , Jan 11, 2007
        • 0 Attachment
          Are people on this list checking out Adobes Spry?

          (I ask because it seems to use json.data.recordSets)

          _________________________________________________________________
          Advertisement: Fresh jobs daily. Stop waiting for the newspaper. Search Now!
          www.seek.com.au
          http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau&_t=757263760&_r=Hotmail_EndText_Dec06&_m=EXT
        Your message has been successfully submitted and would be delivered to recipients shortly.