# Standard Numeric Format Strings

Created by Jessica Rivers (Unlicensed)

Last updated: Nov 13, 2013

Character | Description |
---|---|

A | Standard format string takes the form Axx where A is a single alphabetic character called the format specifier, and xx is an optional integer called the precision specifier (e.g.: D4, C2). |

C,c | Currency. The number is converted to a string that represents a currency amount. The precision specifier indicates the desired number of decimal places. |

D,d | Decimal. This format is supported for integral types only. The number is converted to a string of decimal digits (0-9), prefixed by a minus sign if the number is negative. The precision specifier indicates the minimum number of digits desired in the resulting string. If required, the number is padded with zeros to its left to produce the number of digits given by the precision specifier. |

F,f | Fixed Point. The number is converted to a string of the form "-ddd.ddd" where each 'd' indicates a digit (0-9). The string starts with a minus sign if the number is negative. The precision specifier indicates the desired number of decimal places. |

N,n | Number. The number is converted to a string of the form "-d,ddd,ddd.ddd", where each 'd' indicates a digit (0-9). The string starts with a minus sign if the number is negative. Thousand separators are inserted between each group of three digits to the left of the decimal point. The precision specifier indicates the desired number of decimal places. |

P,p | Percent. The number is converted to a string that represents a percent. The converted number is multiplied by 100 in order to be presented as a percentage. The precision specifier indicates the desired number of decimal places. |

**On this page:**

**Related Pages:**