How to set fraction/decimal places programatically

Hi,
I want to set:
2 decimal places as fraction for INR and 3 decimal places as fraction for GBP & USD in rate field.
Is there any way, that we can do it by writing a code, if yes, then how?

Regards
Ruchin Sharma

I don’t think there is an easy way to format precision based on currency as of now.