Decimal format with Decimal Precision empty

I am using a decimal field… and i wanted to ask you guys if it is possible to define in the attribute Decimal Precision = nothing or empty in order to use the number_format() method and control dynamically the decimals that i want.

If this is zero, i can’t use the number_format method cause i am getting sc error messages for invalid data ?

Can i disable the errors ?

Thank you