Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
WebPercentEditor Round Off
posted

Round off is working fine with infragisitcs V11.1 but it is not working in V21.2?

Please help me!!

Thanks in advance!!

Parents
No Data
Reply
  • 1660
    Offline posted

    Hello Prakash, 

    I have tested this behavior and the value of the WebPercentEditor is being rounded correctly while using server-side code, but it is not being rounded correctly for client-side code. You can easily overcome this by using the parseFloat method and then applying the toPresicion method to round up the numbers. If you would like to use percentages without decimal places I recommend you using toPresicion(2).

    For example, if the value of the WebPercentEditor is 0.2967, the rounded value would be 0.30 and the value that the WebPercentEditor would show would be 30%.

    I am attaching a small sample application that demonstrates the rounding of the value with server-side code and how the value could be rounded using the above stated methods. 

    Please test the sample on your side let me know if you have any questions. 

    Regards,
    Ivan Kitanov

    2844.PercentEditor.zip

Children
No Data