If what you want is to round up if the part-to-be-rounded is larger than or equal to ⅔ of its maximum value, else round down, then I believe you can use the plain round() function by first subtracting ⅙ * wanted precision:

Yes, you can. As you have not described to rules, but I am assume you are aware of what you want, you can covert the number to string, iterate it over character by character and once you reach the character 2 steps beyond decimal. you can act upon your rule.

There is also a builin round function, which can it round the number to a given precision.