Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old April 22nd, 2004, 01:34 PM
hbabir hbabir is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 6 hbabir User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Characters or Anything that represents numbers

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

Reply With Quote
  #2  
Old April 22nd, 2004, 08:38 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 19 h 31 m 41 sec
Reputation Power: 180
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

Reply With Quote
  #3  
Old April 24th, 2004, 01:56 PM
hbabir hbabir is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 6 hbabir User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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...

Reply With Quote
  #4  
Old April 24th, 2004, 02:31 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,751 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 3 h 32 m 46 sec
Reputation Power: 443
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.

Reply With Quote
  #5  
Old April 24th, 2004, 06:03 PM
hbabir hbabir is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 6 hbabir User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Memnoch
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.

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...

Reply With Quote
  #6  
Old April 24th, 2004, 06:55 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,751 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 3 h 32 m 46 sec
Reputation Power: 443
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.

Reply With Quote
  #7  
Old April 29th, 2004, 07:56 PM
hbabir hbabir is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 6 hbabir User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Memnoch
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.
Hi.. Sorry about the late reply..

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

Reply With Quote
  #8  
Old April 29th, 2004, 10:52 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 19 h 31 m 41 sec
Reputation Power: 180
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Characters or Anything that represents numbers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway