- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 05:40 AM
hi
i have a requirement, we have a field that field's value is auto populating we have to set limit to two decimal places to that value. please suggest.
thanks
lakshman
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 07:47 AM
Hi @lakshman nalla ,
What i understand based on your requirement, If the value of the field is 10.12455 and the expected output is 10.12
If the field value is auto-populating from the Client script or BR, You can restrict the value limit by using the toFixed() Javascript method.
var num = 10.1234;
var n = num.toFixed(2);
Output: 10.12
Referral Link : https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_tofixed
Please mark my answer as helpful and the solution accepted if it serves the purpose.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 05:42 AM
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 07:47 AM
Hi @lakshman nalla ,
What i understand based on your requirement, If the value of the field is 10.12455 and the expected output is 10.12
If the field value is auto-populating from the Client script or BR, You can restrict the value limit by using the toFixed() Javascript method.
var num = 10.1234;
var n = num.toFixed(2);
Output: 10.12
Referral Link : https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_tofixed
Please mark my answer as helpful and the solution accepted if it serves the purpose.