How to Round to Arbitrary Precision in any Programming Language: an AMultiply your rounding number by 10^y where y is the precision to round to. Call your language’s built-in round() method on this number. Divide the result by 10^y. Easy peasy. It also makes it easier to implement different rounding methods because you’re always dealing with the digit at the same location in the number.