Printing field Values with 2 Decimal points

G

Guest

I have two number fields in my Access 200 table; FieldA, FieldB
Let say the value of FieldA is 275.01 and the value in FieldB = FieldA/17.55
How do I print both fields to print with 2 decimal places (178.36)?

Thanks
 
O

OfficeDev18 via AccessMonster.com

=Format(FieldX,"##0.00")

Be careful, though, as "##0" allows for maximum 3 places. Only 1 place is
required, however, and if FieldA is <1 it will show up as 0.XX (2-place
decimal). If FieldA can be 10 places, for example, use 9 "#" marks and the 0,
as in "#########0.00". See the Format() function for details and be sure to
read the examples.

Hope this helps,

Sam
 
G

Guest

Thanks, it worked.

OfficeDev18 via AccessMonster.com said:
=Format(FieldX,"##0.00")

Be careful, though, as "##0" allows for maximum 3 places. Only 1 place is
required, however, and if FieldA is <1 it will show up as 0.XX (2-place
decimal). If FieldA can be 10 places, for example, use 9 "#" marks and the 0,
as in "#########0.00". See the Format() function for details and be sure to
read the examples.

Hope this helps,

Sam
 
J

Jamie Collins

OfficeDev18 said:
=Format(FieldX,"##0.00")

Be careful, though, as "##0" allows for maximum 3 places. Only 1 place is
required, however, and if FieldA is <1 it will show up as 0.XX (2-place
decimal). If FieldA can be 10 places, for example, use 9 "#" marks and the 0,
as in "#########0.00".

I'm not sure what you are getting at but the lack of a leading # will
not cause the integer portion to be truncated e.g.

SELECT FORMAT$(1234567890.0987654321,'#0.00')

returns '1234567890.10'.

Jamie.

--
 
O

OfficeDev18 via AccessMonster.com

You are right, Jamie,

and thanks for teaching me something today.

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top