|
|||||||
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Addicted Member
Join Date: May 07
Posts: 167
![]() |
Hi all!
i want to set the precession of a "single" variable to 1.. is is possible in v.b 6.0? if so , kindly tell me. egg: dim x as single x=4.01234 msgbox(x) ' x shole be 4.0 only ......not 4.01234 so i want to round this.. how it is possible....... thanks in advance regards: raghunadhs |
|
|
|
|
|
#2 |
|
Interweb adm/o/distrator
Join Date: Nov 06
Location: Australia, Melbourne
Posts: 2,306
![]() ![]() |
Re: can u say how to set the precession as 1 to a "singel" type data type
vb Code:
Does that help?
__________________
If this post was helpful please rate it If it wasn't for C, we would be using BASI, PASAL and OBOL. VB6: [System Uptime] [Extracting WMP Song] [Basic Flood Protection] [RTF Editor] [Hex/String Conversions] [Reading/Writing INI] [List Files in Directories] C++: [Mute Audio in Vista] VB.NET: [Associating a Help File] C#: [One instance of your application] |
|
|
|
|
|
#3 |
|
I don't do your homework!
Join Date: Jun 00
Location: Good Old Europe
Posts: 2,749
![]() ![]() |
Re: can u say how to set the precession as 1 to a "singel" type data type
Hell-Lord, your suggestion would only work on numbers less then 10. I'd use:
Code:
Dim x As Single
x = 4.01234
MsgBox (Int(x))
__________________
You're welcome to rate this post! If your problem is solved, please use the Mark thread as resolved button Wait, I'm too old to hurry! |
|
|
|
|
|
#4 |
|
Interweb adm/o/distrator
Join Date: Nov 06
Location: Australia, Melbourne
Posts: 2,306
![]() ![]() |
Re: can u say how to set the precession as 1 to a "singel" type data type
Yes >.< should have thought of that thanks.
Also probably use CInt instead of Int but yea much better.
__________________
If this post was helpful please rate it If it wasn't for C, we would be using BASI, PASAL and OBOL. VB6: [System Uptime] [Extracting WMP Song] [Basic Flood Protection] [RTF Editor] [Hex/String Conversions] [Reading/Writing INI] [List Files in Directories] C++: [Mute Audio in Vista] VB.NET: [Associating a Help File] C#: [One instance of your application] |
|
|
|
|
|
#5 | |
|
Addicted Member
Join Date: May 07
Posts: 167
![]() |
Re: can u say how to set the precession as 1 to a "singel" type data type
Thanks to all who replied to my question...........
Thanks for your immediate correspondence... Regards: raghunads.v Quote:
|
|
|
|
|
|
|
#6 |
|
PowerPoster
Join Date: Dec 04
Posts: 11,790
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: can u say how to set the precession as 1 to a "singel" type data type
using the round function you can set to however many decimal places you want
vb Code:
__________________
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part come back and mark your original post as resolved if your problem is fixed pete |
|
|
|
|
|
#7 | |
|
Addicted Member
Join Date: May 07
Posts: 167
![]() |
Re: can u say how to set the precession as 1 to a "singel" type data type
Hai WestConn1!
I want this type of function only.. thank u very much.. regards: raghuandhs Quote:
|
|
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|