Jump to content
Sign in to follow this  
Robert Collins

Custom function for formatting decimal place

Recommended Posts

Hi,

I have 3 fields in a table that contain a currency amount in £ and I have formatted the fields on screen with currency £ and 2 decimal places which for on-screen use , is fine.

I need to use the fields' contents in an email and find that I loose the formatting of 2 decimal places when doing so , which I can understand why - but I want £132.00 to appear as £132.00 , not £132 when using the data elsewhere, such as emails.

is this a job for a custom function? and does anyone have an example I can see.

many thanks

Share this post


Link to post
Share on other sites

is this a job for a custom function? and does anyone have an example I can see.

Lots and lots here. Just search for “currency”.

Share this post


Link to post
Share on other sites

I wonder why the Round (fieldname ; 2 ) doesn't work better in this application

Because rounding is a numerical operation and as such does not produce trailing zeros.

A relatively simple method would be =

"£" & Int ( Amount ) & SerialIncrement ( ".00" ; 100 * Mod ( Amount ; 1 ) )

This assumes Amount is a non-negative number, rounded to 2 decimal places.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.