TitleCase
Functions
- Number(number) ⇒
string
Formats a number to a string with thousand separators.
- TitleCase(str) ⇒
string
Formats a string to title case.
- SentenceCase(str) ⇒
string
Formats a string to sentence case.
- CamelCase(str) ⇒
string
Formats a string to camel case.
- KebabCase(str) ⇒
string
Formats a string to kebab case.
- SnakeCase(str) ⇒
string
Formats a string to snake case.
- DateFor(date, [order]) ⇒
string
Formats a date as a string with a customizable order of day, month and year.
Number(number) ⇒ string
Formats a number to a string with thousand separators.
Kind: global function
Returns: string
- The formatted string.
Param | Type | Description |
---|---|---|
number | number | The number to format. |
Example
TitleCase(str) ⇒ string
Formats a string to title case.
Kind: global function
Returns: string
- The formatted string.
Param | Type | Description |
---|---|---|
str | string | The string to format. console.log(formats.TitleCase(“Example of text”)) |
SentenceCase(str) ⇒ string
Formats a string to sentence case.
Kind: global function
Returns: string
- The formatted string.
Param | Type | Description |
---|---|---|
str | string | The string to format. console.log(formats.SentenceCase(“Example Of Text”)) |
CamelCase(str) ⇒ string
Formats a string to camel case.
Kind: global function
Returns: string
- The formatted string.
Param | Type | Description |
---|---|---|
str | string | The string to format. console.log(formats.CamelCase(“Example of text”)) |
KebabCase(str) ⇒ string
Formats a string to kebab case.
Kind: global function
Returns: string
- The formatted string.
Param | Type | Description |
---|---|---|
str | string | The string to format. console.log(formats.KebabCase(“Example of text”)) |
SnakeCase(str) ⇒ string
Formats a string to snake case.
Kind: global function
Returns: string
- The formatted string.
Param | Type | Description |
---|---|---|
str | string | The string to format. console.log(formats.SnakeCase(“Example of text”)) |
DateFor(date, [order]) ⇒ string
Formats a date as a string with a customizable order of day, month and year.
Kind: global function
Returns: string
- A string representation of the date.
Param | Type | Default | Description |
---|---|---|---|
date | Date | The date to format. | |
[order] | string | ”"dmy"“ | The order in which to display the day, month and year. Can be “dmy”, “mdy”, “ymd”, “ydm”, “myd” or “dym”. |
Example