Percents rounding - How does it stop?! (1 Viewer)

SaraMegan

Starving Artist
Local time
Today, 05:53
Joined
Jun 20, 2002
Messages
185
Hi. I've searched for this topic, but the only thing I found was from April and had no replies... So here goes:

Anyone know why my percents are rounding? I have a field for TestScore, which should hold a percent... I have the field set up as a number field, Integer, Percent, with Decimal places = 1. I have no default value.

If I type in "87" or "87." (hoping to get 87.0%) I get 8700.0%.

If I type in ".87" I get 100.0%

If I type in ".0087" I get 0.0%

Any thoughts on how to change this to a normal percentage? This is probably super-easy, but (like most things) it baffles me...

Thanks!

--Sara
 
Last edited:

SaraMegan

Starving Artist
Local time
Today, 05:53
Joined
Jun 20, 2002
Messages
185
Thanks, Rich. I found it... why does that work? What does it do? What do the single and double mean? Is there a way to do it without having to type in the decimal?

--Sara
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:53
Joined
Feb 19, 2002
Messages
43,474
Single and Double are datatypes that store numbers with decimal places. Long, which is the default numeric datatype, only stores integers. That's why your number was rounding.

If you want to enter percents as whole numbers, you'll need to use an unbound control and in the control's AfterUpdate event divide the value in the control by 100. If you choose to use an unbound control, you'll also need to populate the control in the Current event.
 

Users who are viewing this thread

Top Bottom