- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2021 02:34 PM
I have this code in the server side , it is giving the result as 44.0 I want only 44
current.variables.sds_price = parseInt(current.cmdb_ci.market_value)/1024;
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2021 06:49 AM
Please check sample examples from below link , give a try . let me know if it's still not working.
https://stackoverflow.com/questions/7641818/how-can-i-remove-the-decimal-part-from-javascript-number

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2021 08:33 AM
Hi,
Yes, I read your post and all that. You didn't have to repeat yourself.
My script takes that integer value and strips off the decimal and any digits thereafter (as I've said above) and then places that final value in your variable. No decimal should be there.
Anyways, it seems you've found a correct answer, so that's good. My point is, my script works as I tested it as well on my end.
Take care! 🙂
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2021 06:49 AM
Please check sample examples from below link , give a try . let me know if it's still not working.
https://stackoverflow.com/questions/7641818/how-can-i-remove-the-decimal-part-from-javascript-number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2021 07:43 AM
Thanks Harsh , tried all but none of them seems working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2021 06:56 AM
Hi there,
Could you try:
var floatNum = parseInt(current.cmdb_ci.market_value)/1024;
var intNum = Math.round(floatNum);
current.variables.sds_price = intNum;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2021 07:37 AM
tried this too no luck 😞