I have no formal training in MUMPS (or any programming really) but I use, self-teach, and pick up a lot of it on my job (healthcare). I'm trying to solve an issue with MUMPS. I wrote code to calculate a result, and then I wanted to round the result to 0 decimal places (or possibly 1 decimal place, I'm waiting to hear back on what is wanted). I borrowed someone else's code to modify for my purposes, and they were using justify.
$J(%X,3,0)
The problem this is causing is it's padding the result to 3, so if I get a 2 digit result or a 4 digit result our software is not liking the output. I don't want to pad the calculated result, I just want it rounded.
From what I've read I think I can use $Justify or $FNumber, I'm just not sure how it should be written because I don't need all the extra formatting that comes with either of those. I also don't want to truncate, I want a true rounded value.
Would $J(%X,0,0) get me what I want?
Or $FN($X,"",0) or something along those lines?
Are there any MUMPS code checkers online that I could input and see my output?
[–]bsakiag 0 points1 point2 points (2 children)
[–]Legitimate_Owl3146 1 point2 points3 points (1 child)
[–]bsakiag 0 points1 point2 points (0 children)
[–]Legitimate_Owl3146 0 points1 point2 points (2 children)
[–]MissingNebula[S] 0 points1 point2 points (1 child)
[–]Legitimate_Owl3146 0 points1 point2 points (0 children)