7 Replies Latest reply on May 11, 2015 5:25 PM by disabled_jackrodgers

# How to export number field to text with 2 decimal places

Does anyone have a calculation or other way to accomplish the following:

I have a number field that contains an invoice total.  I would like to export this field into an excel file with the resulting data to be a text value without a decimal point but including two value places to the right of where the decimal point would be.  So I think I need a calculation that will take that number field and turn it into a text field with a value explained in the examples below. Then I would export that calculated field.

The number field I want to work with is called: "Amount"

The calculated field would be called: "Amount_export_c"

Example 1:

Amount = 1

Amount_export_c = 100

Example 2:

Amount = 1.1

Amount_export_c = 110

Example 3:

Amount = 1.23

Amount_export_c = 123

Example 4:

Amount = 401.2

Amount_export_c = 40120

Thanks.

• ###### 1. Re: How to export number field to text with 2 decimal places

Amount_export_c = amount * 100

??

• ###### 2. Re: How to export number field to text with 2 decimal places

Have a look at the Number functions. E.g.:

Int( Amount * 100 )

• ###### 3. Re: How to export number field to text with 2 decimal places

Tom Fitch wrote:

Int ( Amount * 100 )

Right.

• ###### 4. Re: How to export number field to text with 2 decimal places

This does not work. It just adds 2 zero's to whatever amount I have.

so 3.12 turns into 31200 ( so I could strip right(2)) but

3.1 gives me 3100 which stripping does not work....remember that filemaker stores 3.10 as 3.1 and 3.00 as 3 and 3.23 as 3.23

• ###### 5. Re: How to export number field to text with 2 decimal places

mcarey wrote:

This does not work. It just adds 2 zero's to whatever amount I have.

Then something is off with your number (?) field; 3.1 * 100 should return 310, no matter whether the number is internally stored as 3.1 or 3.10.

If 3.12 returns 31200, it suggests that the period is not recognized as decimal character, so the number used is actually 312.

btw, Tom's suggestion is better anyway (when applied to numbers, that is), since it works with any number of decimal places to return the result you described.

• ###### 6. Re: How to export number field to text with 2 decimal places

Int( Amount * 100 )

How to export number field to text with 2 decimal placesNice. Reminds me of the old days...

Works if the field is text...

And Int is good for getting the version numbers. int(get(applicationversion)) = 13 which I am having to use more and more...

• ###### 7. Re: How to export number field to text with 2 decimal places

Mark Tom Fitch as the correct answer...