handlebars-helpers-inflections
v1.0.1
Published
Handlebars helpers for inflecting text
Downloads
4
Maintainers
Readme
handlebars-helpers-inflect
A collection of Handlebars helpers for inflecting and formatting strings and numbers.
A subset of handlebars-helpers.
{{inflect}}
: format a string into singular or plural forms
{{ordinalize}}
: add ordinal suffixes to numbers (7 => '7th')
{{addCommas}}
: Group numbers with commas (9000 => "9,000")
{{toFixed}}
: Convert to a float to a decimal precision.
{{toFloat}}
: Convert a string or integer to a floating-point number.
{{toInt}}
: Convert a string or float to an integer.
{{toPrecision}}
: Convert a number to a given precision.
{{capitalizeFirst}}
: Capitalize first word in a sentence
{{capitalizeEach}}
: Capitalize each word in a sentence
{{center}}
: Center a string using non-breaking spaces
{{dashify}}
: Replace periods in string with hyphens.
{{hyphenate}}
: Replace spaces in string with hyphens.
{{lowercase}}
: Make all letters in the string lowercase
{{plusify}}
: Replace spaces in string with pluses.
{{sentence}}
: Sentence case
{{titleize}}
: Title case. "This is Title Case"
{{uppercase}}
:
{{reverse}}
:
{{count}}
: Return the number of occurrences of a string, within a string
{{replace}}
: Replace occurrences of string "A" with string "B"
{{truncate}}
: * Truncates a string given a specified length
.
{{startsWith}}
: Tests whether a string begins with the given prefix.
License
MIT.