-
I am trying to round a frontend.variable number based on the last three digits. For example, 1234 would be rounded to 1000 since 234 is less than 500 and 1501 would be 2000. However, since there is no modular operation, I am wondering if there is any alternative method to do so? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think there is no direct way. You would have to resort to using hints (non-deterministic computation) to obtain this. Essentially, lets say you have a variable See as an example |
Beta Was this translation helpful? Give feedback.
See also the example in #1362 (comment). In your case it should be a bit different as you have fixed the modulus, so you can hardcode it in the hint etc. But on a high level should be very similar.