generic javascript number/string formatting (bytes, milliseconds...)