Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Large decimal values are getting truncated in listgrid cell

    Hi Isomorphic,

    I am using licensed version of SmartGWT PRO 4.1 (isc.version="v9.1p_2014-06-14/Pro Deployment";isc.versionNumber="v9.1p_2014-06-14";isc.buildDate="2014-06-14")

    Problem Statement

    I am sending below value from server,
    5435435.5435434355535

    Which is having 13 digits after decimal points, but in listgrid cell, it is only showing 9 digits after decimal point.
    I have also tried changing the field type to TEXT, but it is showing the same value (9 digits after decimal point)

    I have checked my server response in browser and the data is correct in response.

    Can you please help solving this ?

    #2
    Hi pratik.thaker,

    your version is ancient, but this thread might apply as well or at least help.

    Please note that this was added in also ancient 5.1 - the property stringInBrowser is not in 4.1.

    Other than that, these docs might be relevant: JavaToJavaScriptConversion.

    I'd try with the number as text field in .ds.xml already.
    If there is some number to text conversion in the browser before displaying it, it might be too late already.

    Best regards
    Blama

    Comment


      #3
      Yes, the number will need to be delivered to the browser as text because the JavaScript engine cannot represent numbers with that much precision.

      The conversion happens automatically as the data is delivered to the browser as JSON, and there is no way, from the client-side, to do anything about it, so you need to deliver the value as text if you want to retain and display that precision.

      Comment


        #4
        Thanks to Blama and Isomorphic for the quick reply and great solutions.

        Sending value in text, and changing ListGridFieldType to TEXT worked fine for me.

        Thanks again to both of you. I will definitely upgrade to latest version soon.

        Comment

        Working...
        X