Formatting Numbers & Dates

In the Format tab of a mapping's formatting settings, there are quite a few numbers & dates options - this page explains those options in detail.

Format as number

In the Format tab, you can select Number:

Here, you can set the number of decimal places and whether to use a 1000 separator. You can also set the Format Locale, which is explained below.

Select Percentage instead of Number to format your field as a percentage:

You can also select Custom Number, which allows you to customize the number formatting:

If you want to make your own custom pattern, please read the information on this page.

For custom date formatting, Y is used for year in the custom date pattern, instead of y. The lowercase y is a calendar year pattern, and the uppercase Y is a week year pattern.

 

Format as currency

In the Format tab, you can select Currency:

Here, you can set the number of decimal places and whether to use a 1000 separator. You can choose the symbol to use, and whether to show it before or after the number. You can also set the Format Locale, which is explained below.

You can also select Custom Number, which contains options for formatting as a custom currency as well:

Format as date/time

In the Format tab, you can select Date:

Here, you can choose how you want your date to be formatted. You can also set the Format Locale, which is explained below.

You can also select Time, which you can use for formatting times:

Select DateTime if you want to include the time as well as the date:

Finally, you can select Custom Date, which allows you to customize the formatting:

If you want to make your own custom pattern, please read the information on this page.

Locale

A locale is a set of parameters that defines the user's language, country and any special variant preferences. Smart Flows uses these parameters to interpret or output data in a certain way.

Document locale

The document locale determines how input data is converted to usable numbers/dates/times. Setting your document locale correctly is very important, as this effectively tells the add-in how it should treat (for instance) a comma or a dot. Some languages use a comma as a 1000 separator and a dot as a decimal separator, while other languages do it the other way around.

Setting the document locale can be done in the Smart Flows options, data formatting tab. You can access the options by clicking Options in the Smart Flows ribbon:

Format locale

The format locale determines the formatting of your output. For instance, when you choose to format your field as a Number, the locale then decides which symbols will be used for the 1000 separator and decimal separator.

Difference between document locale and format locale

Simply put, the document locale determines how your input data is interpreted, while the format locale determines the formatting of your output. In other words, input data is converted to a usable number/date, after which you decide how it looks in the final document.

Supported locales

This page shows which locales are supported by Smart Flows.

Examples

We'll use the following example to explain the difference between the document locale and formate locale:

  • This is our input data: 10,000.25
  • In the mapping settings' Format tab, we choose to use a 1000 separator and 2 decimal places

Then, we use the following document locale and formate locale:

  • Document locale: el_GR (Greek, Greece)
    • 1000 separator: . (dot)
    • Decimal separator: , (comma)
  • Format locale: en_GB (English, United Kingdom)
    • 1000 separator: , (comma)
    • Decimal separator: . (dot)

The document locale is wrongly set to Greek - it's wrong because the input data uses a comma for the 1000 separator and a dot for the decimal separator, whereas the Greek locale is the other way around. Now that the input data is processed incorrectly, the format locale doesn't matter - it won't ever be shown correctly.

To show you how important the correct locale is, here is the result of processing the input data as Greek and outputting it as English: 100,002,500.00. This is completely wrong!

Here's an example, using the same input data but a different document locale:

  • Document locale: en_GB  (English, United Kingdom)
    • 1000 separator: , (comma)
    • Decimal separator: . (dot)
  • Format locale: en_GB (English, United Kingdom)
    • 1000 separator: , (comma)
    • Decimal separator: . (dot)

This document locale is correct, as our input data uses the same 1000 and decimal separator as the document locale. Here's the result of this locale setup: 10,000.25. That's how we wanted it!

Now that the document locale is correct, we can use a different format locale to format the output according to the user's preference. For instance, we're setting up a template for use in Dutch-speaking Belgium, so we use the following locale:

  • Format locale: nl_BE (Dutch, Belgium)
    • 1000 separator: . (dot)
    • Decimal separator: , (comma)

Here's the result of the output: 10.000,25. Notice how this differs from the input data (10,000.25) only in the 1000 and decimal separators.

What you can do

Now that you know how the document locale and format locale work, you should try and match the document locale to the input data. This ensures that Smart Flows uses the correct values. Once you have that set up properly, you can decide how you want to output your numbers/dates. Using a different format locale is most useful when working with multiple countries that use different 1000 and/or decimal separators.