Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8256 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

In my database I have some dollar amount fields (as an example they are formated like $500.56).

There is a field calculation that adds them all up to a total. It is also formated like $2,125.63

When I show the dollar amount fields and the total amount field in cdml on a web page I get something like 2125.626875

I tried doing numbertotext calculation fields, and adding in a $ sign for good measure. Then linking the CDML to the numbertotext fields...

Now I get $2125.626875

Solves the dollar sign, but can't figure out how to get the decimal figures to show up correctly as $2,125.63 on the web page.

LR

[ April 08, 2002, 10:58 AM: Message edited by: Larry Ross ]

Posted

Hi there. I had the same problem. I solved it by using the round function in the FM program and have it round to two decimal places after the whole number....like this:

round(field_name,2)

Posted

Try this calc. Rename "DollarAmt" in this calc to the name of your field. The result of this calc is text.

"$"&NumToText(Int(DollarAmt))&Left(Round(NumToText(Mod(DollarAmt , 1 )) , 2 ),3)

Hope this helps

Posted

"$"&NumToText(Int(DollarAmt))&Left(Round(NumToText(Mod(DollarAmt , 1 )) , 2 ),3)

If the field DollarAmt contained $500.00, this calculation returned the result $5000

If the field DollarAmt contained $500.37, this calculation returned the result $500.37

So this calc does not work if it is a .00 amount?

LR

[ April 08, 2002, 12:06 PM: Message edited by: Larry Ross ]

Posted

round(field_name,2)

This calculation changed the amount of $1,500.37 into $1500. 37

Changed the amount of $1,500.00 into $1500

Changed the amount of $1,500.30 into $1500. 3.

Is there a way to have it add in the , between the 1 and the 5?

If a original number ends in .00 it drops off the .00?

If a number ends for example in .30 it drops off the 0 thus making a number look like 1500.3 this looks a bit odd.

LR

[ April 08, 2002, 12:34 PM: Message edited by: Larry Ross ]

Posted

Thanks so much for all the suggestions. I tool a look at the thread. Here is the one that worked.

"$" & Left(NumToText(FieldName + .001), Length(NumToText(FieldName + .001)) - 1)

It still never ceases to amaze me on how many different ways in FileMaker there are to accomplish the same thing.

LR

[ April 08, 2002, 08:07 PM: Message edited by: Larry Ross ]

This topic is 8256 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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