🖼️
KASKO Frontend Documentation
  • README
  • Getting started
    • Setting up a new webapp
    • Webapp manifest
    • Building the flow
    • Defining layouts
    • Defining computed values
    • Defining dynamic paths
  • Core concepts
    • Forms
    • Validation
      • Using existing validators
      • Adding custom validators
    • Configuration
      • Price format
      • Date format
    • Performing API calls
    • Toggling visibility of components
    • Translations
    • Rules For Robust Application
  • Guides
    • Using logical statements (JsonLogic)
    • Adding discount codes
    • Developing Custom Plugins
    • Setting required requests
    • Adding save quote for later
    • Transforming request data
    • Manifest merging strategy
    • Knockout flow
    • Local pricing logic
    • Setting up dashboard policy profile
    • Handling offers
    • Repeater
  • Snippets
    • Reset input state
  • Useful resources
    • All component descriptions
    • JsonLogic core documentation
    • Kasko.js documentation
    • Example webapp
    • Example plugins (w/ various frameworks)
Powered by GitBook
On this page
  1. Core concepts
  2. Configuration

Price format

Price format (also known as currency template) is used to define the way how prices should be displayed. The template can be set globally (in manifest config object) and then it can be overridden in various parts of an application (for example, in translations).

Default currency template: (currency) (amount)

Example webapp manifest

{
  "version": "1.0",
  "schema": {
    "config": {
      "currency_template": "(currency) (amount, 1.2-2, ',', ' ')"
    }
  }
}

There might also be case where currency symbol should be used, in that case, currency in configuration should not be changed, instead "currency" in currency_template should be replaced with "currencySymbol". Angular will automatically transform currency to symbol.

For example to get output like "1 234,56€" config should look like so:

{
  "version": "1.0",
  "schema": {
    "config": {
      "currency_template": "(amount, 1.2-2, ',', ' ')(currencySymbol)"
    }
  }
}

Configuration string in most cases looks like this (currency) (amount, 1.2-2, '.', ' ') where:

  • currency represents currency variable for example "EUR", "USD" etc.

  • amount represents monetary value and it's format configuration sequence separated by comma (,). If some of the values use comma (,), space ( ) or quotes ("|'), then those values should be wrapped in differing quotes e.g. ",","'", '"':

    • DigitsInfo decimal representation options, specified by a string in the following format:{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}. e.g.: 1.2-2

    • DecimalSeparator separator symbol for decimal point. e.g.: ","

    • ThousandsSeparator separator symbol thousands. e.g.: "'"

Customize price format on Content (translation) level with asCurrency transformer.

Last updated 1 year ago

currencySymbol represents monetary value as a symbol transformed from currency variable with method. In "EUR" case it would be "€" etc.

Sometimes there is a requirement to have a different price format in a specific content string. More information how this can be done is found in guide.

getCurrencySymbol
translations