spikepl
Eledittingent Beliped
- Local time
- Today, 18:33
- Joined
- Nov 3, 2010
- Messages
- 6,142
I have a product where the result is to be expressed in percent:
MyPercentage= 100 * N * Z /R , where N is Integer, Z and R are Single and MyPercentage is Single.
When N = 600, I get an integer overflow. Obviously the calculation proceeds from left to right, and 100 * 600 hits the Integer roof of Access. Of course I can multiply by 100 last, as in :
MyPercentage= N * Z /R * 100
and then everything is fine.
Originally, since I come from a different language, I tried by tradition to type:
100.0 * N * Z/R but Access would on the fly convert the 100.0 to 100# .
What is 100# ?
MyPercentage= 100 * N * Z /R , where N is Integer, Z and R are Single and MyPercentage is Single.
When N = 600, I get an integer overflow. Obviously the calculation proceeds from left to right, and 100 * 600 hits the Integer roof of Access. Of course I can multiply by 100 last, as in :
MyPercentage= N * Z /R * 100
and then everything is fine.
Originally, since I come from a different language, I tried by tradition to type:
100.0 * N * Z/R but Access would on the fly convert the 100.0 to 100# .
What is 100# ?