Maybe there already is some formatting functionality in dart (maybe in intl?). Check it and use it if it exists.