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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Who Viewed the Topic

    1 member has viewed this topic:
    SRBENET 
×
×
  • Create New...

Important Information

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