# Number

The Flow XO Number service allows you to perform mathematical operations on the input you give, to get a 'result' as an output.

The following action are available (there are no triggers):

**Calculate**- Perform a mathematical operation on your input, to generate a 'result' as output. Here's a full list of possible operations.**Format Number**- Change the format a of a number you give. Useful for adding trailing 0s to numbers when you need to give eg, a currency amount with cents, There's a full list of formats here.**Generate Random Number**- You'll output a single number which exists between a minimum and maximum you provide.**Unformat Number**- A useful action that strips out any special formatting to numbers, such as currency symbols and commas, and leaves you with a 'vanilla' number.

Working with numbers is of course pretty straightforwards. We'll look at some example of each action below.

## Calculate

In this action, you'll just be asked to give one input - an 'Expression'. In the input, just like any other Flow XO field, you can give either one or more outputs you've generated earlier in the flow, text written by hand, or a combination of the two.

The full reference for all the operations you can use is here. Handily, you can form your expression just like those in the 'Examples' column.

You'll get a single output here, which is the result of your calculation.

As a very simple example, entering
* 2 + 2* into the input of this method will yield the output......

*!*

**4**## Format Number

Often you'll find some helper text on a field in Flow XO that specifies that you have to give an input in a particular way. even though the output you have available looks quite different. That's exactly the situation that you'll use this action.

Let's imagine we use some invoicing software that gives us a invoice amount output of
**£2,204.45**

That's passed into the first input of this action.

My CRM platform requires just a basic number, with a set of numbers, a full stop, and then two decimal places.

In the second input, I can select a 'Format' of
* 0.00 *from the select box list, which will return an output of

**2204.45****r**eady to be used as an input into my CRM action-input later in the flow.

There's a range of formats to select from in the Flow XO in input, or advanced users can edit the select box to enter their own custom format - there's a full list of possible formats here.

## Generate Random Number

This action does exactly what you'd expect - gives you a random number. This could be useful for generating passwords, or creating stock numbers (SKUs) or customer reference numbers. Of course if you do that you should make sure you are confident the inputs you give allow confidence that you won't get duplicates.

The two inputs to this action are 'Minimum' and 'Maximum', which define the two numbers between which your random number will be created, inclusive. As a simple example, entering
* 0 *as the minimum and

*as the maximum will return as an output, at random, one of the numbers 0,1,2,3,4,5,6,7,8,9 or 10.*

**10**## Unformat Number

A simple action that removes any special formatting to a number and gives you an output of a standardized, 'vanilla' number. Useful for standardizing data inside your apps, or where you might have customers entering eg, their telephone number as free text into a webform.

In that example, a customer might give
* +1541-754-3010 *in your webform, which you'll pass an the input to your 'Unformat Number' action. The output you'll get from this is

**15417543010**