Textbox decimal places format

Bobby1st

Registered User.
Local time
Today, 17:46
Joined
Jan 5, 2007
Messages
62
Hello,
I have two columns on a table, one Col A is an integer with zero decimal places and in Col B is formatted to 3 decimal places (0.020).

On the Report I have a textbox with data source formula: = iif([Col A]= 0, [Col B], [Col A]) If I format the textbox with 3 decimal place and the result in Col A is 2, it will show 2.000. I wanted it to show just "2". If the result is from Col B, it will be perfect.

If I format the textbox to zero decimal places and the result is from Col B, say 0.310, it will show as "0" or even I made the format as 1 decimal places still cut-off.

How would I make the decimal format conform with the result?

Thank you.
 
Last edited:
in a text box control source put
=FormatNumber([fieldname],1)
that will give you one number after the decimal
 
What data type is column B?
 
try general number format

look for it - general will give general date first
 
Hello Guys, Please see next one below. Thanks,
 
Last edited:
Hello Guys,

It's half working, I tried various configurations, Here's what my table and report formats.

. . . . The dots are for spacing only.

Table contains:
EmpId, Month, OP1, Create, OP2, Treat, OP3, Act, etc.
AA . . . Nov07 . . . . , 0.010, . . .,0.010,. . . . , 0.010
AA . . . Dec07 . . . . , 0.010, . . .,0.010,. . . . , 0.010
AA . . . Jan08 . . 2 . , 0.010, . 2 .,0.010, . 2 . , 0.010
AA . . . Feb08 . . 3 . , 0.015, . 3 .,0.015, . 3 . , 0.015
AA . . . Mar08 . . 3 . , 0.015, . 3 .,0.015, . 3 . , 0.015

OP1 = Integer
Create = double


Textbox decimal Place format is 3 for OP1/Create
=IIf([OP1]="",[Create],formatnumber([OP1],0))

Report results

EmpId, Month, OP1/Create, I want it >> OP1/Create,
AA Nov07 . . . . . . . . . . . . . . . . . . 0.010
AA Dec07 . . . . . . . . . . . . . . . . . . 0.010
AA Jan08 . . . . . 2 . . . . . . . . . . . . . . 2
AA Feb08 . . . . . 3 . . . . . . . . . . . . . . 3
AA Mar08 . . . . . 3 . . . . . . . . . . . . . . 3

Thanks,
 
Last edited:
Help, same issue here

Anybody figure this out. I have exact same issue.

I have a text box. General Number, two decimal places.

when I enter .50 it displays 0 (zero).
when I enter .55 it displays 1.
when I enter .75 it displays 1.
when I enter 1.60 it displays 2.

Basically it either rounds up or down, and does not have the functionality to enter the exact figure I input like .50 or 2.75.

Hoping someone can steer me in the right direction.

Thanks in Advance.

EDIT: Wow, I found the answer myself. Shocking.

It was in the actual settings of the hours in the table, which is linked to my text box.

Here are my settings: I think it was the fact that field size was set to integer and not decimal and scale was set to 0.

Field Size: Decimal
Format: General Number
Precision: 10
Scale 4:
Decimal Places: 4

~jwood29
 
Last edited:
Jwood29,

Here are my settings: I think it was the fact that field size was set to integer and not decimal and scale was set to 0.

Field Size: Decimal
Format: General Number
Precision: 10
Scale 4:
Decimal Places: 4

I appreciate this direction, IT WORKS!!
Although our situation is not exactly the same but close, I am dealing with integer and decimals.

My text box which contains: =IIf([OP1]="",[Create],formatnumber([OP1],0)) now contains IIf([OP1]="",[Create],[OP1]), Thank you to Fifty2One. The reason for the changes was it won't pickup the value from [Create] if [OP1] contains zero.

I did the changes on the table properties using your GREAT idea. You deserve a Kudos through your reputation.

Once again thank you.
Bobby1st
 
I found this solution via the search feature... it is exactly what I was looking for and it worked flawlessly.
Thanks, folks!
Dave
 

Users who are viewing this thread

Back
Top Bottom