Adapted formatting functionality, using more NumberFormat.