Format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On a report I have a field that can contain numbers ranging from 2000 to
0.175 (in milligrams). I have tried Format(<string>,"0.###") to get rid of
the zeros when the number is whole, but the decimal point remains. Can I
adjust the user-defined expression or will I need to write a short routine to
remove the decimal point?

TIA for any help.

Sandy
 
Sandy,
Try just... Val(<String>)
Given MyString = "2000.00"... Val(MyString) displays as 2000
Given MyString = "20.142" ... Val(MyString) displays 20.142

As you know, this really should be a Num Single field... and
I'm not sure, but there may be some pitfalls down the road,
when using a text field to hold whole and decimal numbers.

--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."
 
Thanks alot Al. Should work.

Sandy

Al Campagna said:
Sandy,
Try just... Val(<String>)
Given MyString = "2000.00"... Val(MyString) displays as 2000
Given MyString = "20.142" ... Val(MyString) displays 20.142

As you know, this really should be a Num Single field... and
I'm not sure, but there may be some pitfalls down the road,
when using a text field to hold whole and decimal numbers.

--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."
 
As you know, this really should be a Num Single field

I don't. When the measure is 'milligrams', I think the value should be
stored using an exact numeric such as DECIMAL, rather than an
approximate type.

Jamie.

--
 
Back
Top