Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi,
I am displaying some properties(decimal values) in property display widget. I need to restrict the values after decimal to 2 digits. How to achieve this in property display widget?
Hi @Sruthi,
JS code like below can be used in service to restrict the values after decimal to 2 digits:
var num =2.446242342; num = num.toFixed(2)
Thanks,
/Yoyo
Is there any other solution other than this?
Hi @Sruthi,
I don't think there is any other solution except this, because we can only consider to restrict the decimal in service or mashup widget. The value display widget doesn't have this function in OOTB, so we can only consider to define that through service output.
Or you need to consider customization on widget.
Thanks,
/Yoyo
Hi @Sruthi.
If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon
Hi @Sruthi
I believe this thread is duplicate of https://community.ptc.com/t5/ThingWorx-Developers/fixed-decimals/m-p/727636#M51930
Could you please check and mark one of them as accepted solution if your already receive the solution.
Hi, In my last response i have posted the duplicate thread of this thread which is already marked as accepted solution. Could you please park this post accepted solution as well for the benefit of other community user and to avoid any confusion in future.
Regards,
Mohit