safe handling of number formatting