Formatting
WireBootstrap provides a number of options for string, numeric, and other type formatting.
String Formatting
WireBootstrap adds a string extension called format
that allows variables inside a string expression to be replaced by values. The variables are expressed using the numeric index position of the variables within the string in curly brackets {}
.
Number Formatting
Numeric values can be formatted using the format
method with a format specification. Valid values are C[N], P[N], N[N] where [N] is the number of decimal places.
The example below sets the formatting for a number to one decimal place using the N1
parameter in the format
function.
Custom Formatting
The format method can also accept a custom function in order to format data.
The following example formats a date field called date_field
using the third party library moment.js.
For more on formatting, visit the core wire reference page.
Last updated