Formatting Dates and Numbers
To globalize your application, register the appropriate culture while registering the C1 MVC scripts. MVC includes over 40 culture files you can choose from.
Dates
Dates are formatted using the Globalize.formatDate function. For details regarding format strings, please refer the online documentation.
Format | Description | Result |
---|---|---|
d | Short Date Pattern | 5/15/2025 |
D | Long Date Pattern | Thursday, May 15, 2025 |
f | Full Date/Time Pattern (short time) | Thursday, May 15, 2025 5:00 AM |
F | Full Date/Time Pattern (long time) | Thursday, May 15, 2025 5:00:47 AM |
t | Short Time Pattern | 5:00 AM |
T | Long Time Pattern | 5:00:47 AM |
'Q'Q yyyy | Quarter/Year | Q2 2025 |
MMMM dd, yyyy | Custom format | May 15, 2025 |
In addition to the standard .NET format specifiers, our MVC controls support
a few additional specifiers including 'Q/q' for quarter, 'U/u' for
fiscal quarter, and 'EEEE/eeee' for fiscal year.
Numbers
Numbers are formatted using the Globalize.formatNumber function. For details regarding format strings, please refer the online documentation.
Specifier | Description | Result |
---|---|---|
n* | Number | 1,234.57 |
n*, | Number (thousands) | 1.23 |
n*,, | Number (millions) | 0.00 |
f* | Fixed-point | 1234.57 |
g* | General (no trailing zeros) | 1234.57 |
d* | Decimal (integers) | 1235 |
x* | Hexadecimal (integers) | 4d3 |
c* | Currency | $1,234.57 |
c*€ | Currency (explicit currency symbol) | €1,234.57 |
c* | Currency (no currency symbol) | 1,234.57 |
p* | Percent | 123,457.00% |
Our numeric formats allow you to include an explicit currency symbol
instead of the symbol of current culture.
For example, an English application may need to generate lists with
amounts in Dollars, Euros, and Yens.