# How to map with Format: Number

**URL:** <https://forum.alumio.com/t/how-to-map-with-format-number/381>\
**Category:** Transformers\
**Tags:** mappers, data-transformer\
**Created:** [January 11, 2023, 4:13pm UTC](https://forum.alumio.com/t/how-to-map-with-format-number/381 "2023-01-11T16:13:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![r.candrian](https://forum.alumio.com/user_avatar/forum.alumio.com/r.candrian/32/235_2.png) [@r.candrian](https://forum.alumio.com/u/r.candrian)\
**Post date:** [January 11, 2023, 4:13pm UTC](https://forum.alumio.com/t/how-to-map-with-format-number/381/1 "2023-01-11T16:13:50Z")

</div>

## Introduction

The Format: Number Mapper allows you to change the data type string to a number. Usually used to denote value, for example, prices.

This guide will provide a sample of how you can use this mapper.

## **Usage**

1. Create a new **Value mapper**.
2. Configure the accessor to access the attribute to the value that you want to map.
3. Add a new mapper and choose **Format: Number**.
4. Here you will get some fields to fill in.

 ![image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/2X/0/09a7333069d8b04fb8e4388a3fd927d1c0610acd.jpeg)

- **Decimals**. The number of decimal digits. If 0, the decimal point is omitted from the return value.
- **Decimal Point**. The separator for the decimal point.
- **Thousand Separator**. The thousands separator. However, it’s possible to use this mapper without the thousand separator as it’s optional now.

## **Example**

For example, you have the below data in an entity, and you need to format the number of the “price” property from 1299 to 1,299.00.

```auto
{
  "sku": "SKU001",
  "name": "T-Shirt 001",
  "price": 1299
}

```

JavaScript

You can use this transformer to format it to the mentioned format.

---

<div class="post-metadata">

**Author:** ![abubakar](https://forum.alumio.com/letter_avatar_proxy/v4/letter/a/8491ac/32.png) [@abubakar](https://forum.alumio.com/u/abubakar)\
**Post date:** [June 19, 2023, 9:35pm UTC](https://forum.alumio.com/t/how-to-map-with-format-number/381/2 "2023-06-19T21:35:29Z")

</div>

How can I adjust the number of digits in a given number to meet a specific format?

**Example**

Lets reproduce 9 in 9 digits

expected solution: 000000009

---

<div class="post-metadata">

**Author:** ![r.candrian](https://forum.alumio.com/user_avatar/forum.alumio.com/r.candrian/32/235_2.png) [@r.candrian](https://forum.alumio.com/u/r.candrian)\
**Post date:** [June 20, 2023, 7:29am UTC](https://forum.alumio.com/t/how-to-map-with-format-number/381/3 "2023-06-20T07:29:16Z")

</div>

Hi Abubakar,

It can be achieved by using **String: Prepend** and then using **String: Cut**.  
Please see below for an example:

 ![MicrosoftTeams-image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/1X/68d3b704a02c4b0e04821aaa94291f4a5c0c7c52.png)
