Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove .00 in Number in a Formula 2

Status
Not open for further replies.

borisbe

Technical User
Aug 15, 2005
73
US
I hope I can explain this so it makes sense:

I have two number fields that I have been added to one formula (Field 1 + Field 2) so had to convert them to text so I could have the '+' in the formula:

Examples:

$10.00 + $5.00
$10.00 + $7.50
$9.50 + $6.00
$20.00 + $10.75

In the formula, what can you do so it shows as:

$10 + $5
$10.00 + $7.50
$9.50 + $6
$20 + $10.75

Help is appreciated.
 
You didn't really need to convert them, you can drop them into a text object, and then right click each and select it's formatting as well.

In a formula try:

totext({table.field1},0,"") & " + " & totext({table.field2},0,"")

Note that the second parameter passed is the character to be used as the thousand seperator, I used nothing here.

-k
 
Hi IdoMillet,

I tried both of those functions and it rounds the numbers so 7.50 showed as 8.
 
Hi,
( If I may, synapsevampire ) -
Replace the 0 with a 1 in the formula..

( That number controls the # of decimal places shown).



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I tried:

totext({table.field1},1,"") & " + " & totext({table.field2},1,"")

***

It shows as

10.0 + 7.5

***

Instead of

10 + 7.50
 
Hi,It gets a little complicated but try:

@f1
If ({table.field1} MOD 2) = 0 then
totext({table.field1},0,"")
else
totext({table.field1},2,"")

@f2
If ({table.field2} MOD 2) = 0 then
totext({table.field2},0,"")
else
totext({table.field2},2,"")

@showthis
{@f1} & '+' & {f2}




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks for everyone trying to help me. I just had to slightly modify turkbear's formula and it worked wonderfully. Changed the 0 to a 1 in the if part of the statement (with 0, it rounded the number):

If ({field} MOD 2) = 1 then
totext({field},0,"")
else
totext({field},2,"")

This made my day end great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top