|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Hi..
Can anyone tell me if there are any chracters or anything else that represents a vlaue (number). For example.. If a value entered (1.23) is lower than ?.5 I want it to have a loop which will add it up to (1.5).. This is only an example.. Hope you do know what I'm talking about.. I just need something that represents the first value e.g (?.23), because the value entered could be anything.. kind regards |
|
#2
|
|||
|
|||
|
I don't think so, and I confess I really don't understand why you need a numeric wildcard anyway
![]()
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
I need something that will round any two digit number to the next highest number.. that's why.. My program calculates the total by finding out the number of boxes of an item required, so u can only have whole boxes, which means the number has to be rounded to the next highest number...
Otherwise the calculations wouldn't be right.. ...HusBab... |
|
#4
|
||||
|
||||
|
if it is less than .5, then make it 1, else convert it to an integer using CInt() and it round it up or down.
|
|
#5
|
|||
|
|||
|
Quote:
Thanx for the idea.. But I really need something that will always round up the number to the next highest number, doesn't matter what the decimal points are.. I know this is confusing, but otherwise the calculations don't seem to be right.. Kind regards ...Husbab... |
|
#6
|
||||
|
||||
|
for values less than 1.0, use CInt() and add 1 to it.
for values greater than 1.0, use Fix(), which removes everything after the decimal point and add 1 to it. |
|
#7
|
|||
|
|||
|
Quote:
I do know the way your thinking, I guess i couldn't explain what I was really looking for.. I suppose it's impossible, unless there is a magic to it.. The values user enters in can vary from 0.1 to ? anything.. of course, which can include decimal points.. Basically, I want the system to round up any numbers with a decimal point, to the next highest number. e.g. Doesn't matter whether it is a 1.1 or a 1.9 it should still round it to 2.. If I do use your method, it will keep adding 1 to anything that above 1.0.. doesn't matter if it has a decimal point or not.. Thanx a lot for the answers.. Kind Regards |
|
#8
|
|||
|
|||
|
The round function may work
http://msdn.microsoft.com/library/e.../vsfctRound.asp Or, another method is to just strip the fractional part and then add 1. Integer divide will let you do this. NewNum = (OldNum \ 1) + 1 This is a completely redundant post if fix or int do no rounding, I haven't checked. ![]() |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Characters or Anything that represents numbers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|