Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BoolFormats = &entity.FormatConfig{ Default: "Yes/No", Options: []string{ "Yes/No", "True/False", "Sí/No", }, }
BoolFormats provides boolean display format options.
var CurrencyFormats = &entity.FormatConfig{ Default: "$#,##0.00", Options: []string{ "$#,##0.00", "€#,##0.00", "#,##0.00 USD", "#,##0.00 €", }, }
CurrencyFormats provides common currency format options.
var DateFormats = &entity.FormatConfig{ Default: "DD/MM/YYYY", Options: []string{ "DD/MM/YYYY", "MM/DD/YYYY", "YYYY-MM-DD", "D MMMM YYYY", "MMMM D, YYYY", "DD MMM YYYY", }, }
DateFormats provides common date format options.
var DateTimeFormats = &entity.FormatConfig{ Default: "DD/MM/YYYY HH:mm", Options: []string{ "DD/MM/YYYY HH:mm", "YYYY-MM-DD HH:mm:ss", "D MMMM YYYY, HH:mm", "MMMM D, YYYY hh:mm a", "DD/MM/YYYY hh:mm a", }, }
DateTimeFormats provides common datetime format options.
var NumberFormats = &entity.FormatConfig{ Default: "#,##0.00", Options: []string{ "#,##0.00", "#,##0", "#,##0.000", "0.00", }, }
NumberFormats provides common number format options.
var PercentageFormats = &entity.FormatConfig{ Default: "#,##0.00%", Options: []string{ "#,##0.00%", "#,##0%", "#,##0.0%", }, }
PercentageFormats provides common percentage format options.
var PhoneFormats = &entity.FormatConfig{ Default: "+## # #### ####", Options: []string{ "+## # #### ####", "(###) ###-####", "### ### ####", "+##-#-####-####", }, }
PhoneFormats provides common phone format options.
var RUTFormats = &entity.FormatConfig{ Default: "##.###.###-#", Options: []string{ "##.###.###-#", "########-#", }, }
RUTFormats provides Chilean RUT format options.
var TimeFormats = &entity.FormatConfig{ Default: "HH:mm", Options: []string{ "HH:mm", "HH:mm:ss", "hh:mm a", "hh:mm:ss a", }, }
TimeFormats provides common time format options.
Functions ¶
func FormatBool ¶
FormatBool formats a boolean according to the pattern. Pattern format: "TrueValue/FalseValue" (e.g., "Yes/No", "Sí/No")
func FormatNumber ¶
FormatNumber formats a number according to the pattern and locale. Supports patterns like: #,##0.00, $#,##0.00, etc.
func FormatPhone ¶
FormatPhone formats a phone number according to the pattern. Pattern uses # as digit placeholder.
Types ¶
This section is empty.