o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Rounding numbers to 2 decimal places - how to (Rounding) -

I am returning math to a variable (and/or a text box) BUT I only want to have two or three decimal places, that are rounded off.

I cant figure out how to round them. I've tried setting text box properties, calling 'as currency' but I dont know what else to do.

Thank you.

 

Rounding numbers to 2 decimal places - how to (Rounding) -
I am returning math to a variable (and/or a text box) BUT I only want to have two or three decimal places, that are rounded off. I cant figure out how to round them. I've tried setting text box properties, calling 'as currency' but I dont know what else to do. Thank you.


MS Access 97 Database Decimal Problem -
Hi Ive created a DB for VB6 Now a field cost has the following field size : long integer format : general integer decimal places : 2 Now whatever value is being put there.. its getting rounded off.. I want it to be stored as 2 decimal places.. So eg : I want the fi


SQL Sum function not giving decimals -
I need to use the sum function, but it is not adding up my decimal places an appears to be rounding the numbers. What can I do? Also, is there a way to set everything to have 2 decimal places. Thanks for your help again.


Formating Question, I think.. -
I have a number like this: 189.5652 I'm never to sure how many places after the decimal it will be, but I need to chop off the end, so there is only places after the decimal. No rounding or anything like that. How could I do this?


Rounding of decimal places -
how do you round of decimal places if i have Minutes = time / 60 Minutues = 1.6666666 how do i round it to like 2 decimal places


Simple question (I presume) -
Ok this is annoying me a little... I've got a number of type decimal equal to '100'. I am trying to set it so that it will display on the page as '100.00' (ie. 2 decimal places). I've tried the rounding functions to 2 decimal places but they dont seem to include the .00, they just r


help my numbers are rounding off -
i'm doing a order form, they only problem i am having is my output, all the numbers are rounding off instead of showing decimals, here is my code if someone wants to look at it and tell me what i'm dong wrong, thanks.


Problem with rounding a number! -
In real life, When we try to round a number, let say 3.825, up to 2 decimal points, the answer is 3.83, right? Unfortunately in VB .NET, the "Math.Round" method & "Decimal.Round" method, round number like this (Read the remarks I quote from the Help file m


Javascript - Rounding numbers to two decimal places -
Here is my code: function Tot() ( var first = parsefloat(document.frm.text1.value) var sec = (first * 0.46 *) / 105 document.frm.text2.setattribute("value", sec) I want to know how with my code, how to round my result to decimal places.. So when I plug a numbe


Knocking off decimal places -
Is there an easy way to knock off the decimal places on a number, without it rounding up/down? I literally need to find the whole number but I couldn't think of any functions i could use.


keep from rounding -
I have some formulas outputting to a text box. The numbers keep rounding up. How do I stop this?


Rounding Numbers in VB -
are you rounding or just truncating? your example of 100.956 should round to 100.96 not 100.95 serge's code rounds which is not what your example shows


Easy and Stupid Question But....... -
Hi, I am having a problem with my database. It seems to be rounding up numbers. I have the field in the database as a number with 2 decimal places. If I enter in 7.6 it rounds it up to 8. How can I fix this? Thanks in advance. Mike


Least rounded -
Which datatype is the least rounded datatype? I am doing an accounting program and the numbers I am getting are a small amount off of the numbers I found by band. Usually a couple hundred. I have tried using single and double datatype, but they give the same result. My numbers ar


Var to textbox -
hay all, I trying to enter a varible result into a textbox, but i want it to display to 2 decimal places.. without changing the number at all. the decimal number will be the result of a varible sum. example. dim a as decimal dim b as decimal a = 36.66 b = 36.54 me.t


rounding and cant be more than question. -
hey, how can i make something round to no decimal places and have it so that the end number cant be more than 150. so that if its 155 it shows 150.


rounding to a specific place -
when I have cin >> dprice; get a double value and I type in 8.88, it gets immediately stored as 8.8800000000000008. Now the real questions about this would be like why does it do that, why don't they fix that, and why do people still use C++ when it does stuff like that? But my


Rounding Numbers Within A Textbox -
Hi, Im fairly new to vb.NET, The problem I have is that I want to round a number down instead of it being rounded up. I want to round 10.389 to 10.38 instead of it rounding to 10.39, is this possible? thanks in advance.


rounding nums -
how can i make it so that my program rounds text1.text only as far as 2 decimal places ex: 1.54 THANX


2 decimal scan and re-display -
can anyone show me how to scan a textbox value let say if someone enter value : 12.123 automatically or immediately the value will be set to 2 decimal places like 12.12 Note : No Rounding ..... Thank you I will be waiting immediate respond


rounding decimal places in textbox -
well i am using the following code to round off decimal places in my textbox which has calculation result. the problem i am facing is that in the form i have many textboxes. is there a way to write single code for all of them? Dim MyVar, pi pi = 3.14159 MyVar = Round(pi, 2) '


Rounding Down To 2 decimal places -
I have a value stored in 'invval'. Inval for example currently is valued at 1695.347352. For VAT Purposes i have to ROUND DOWN to the nearest 2nd decimal place so would need an outcome of £1695.34 not .35. currently im using format(inval,"#.##") to display this valu


stop rounding up -
I have some formulas outputting to a text box. The numbers keep rounding up. How do I stop this?


Format -
Anyone know how to format a decimal without rounding so if I want to keep 4 decimal places 2.255555 becomes 2.2555 not 2.2556. so far I've had no luck with the format function and the length of the decimal is unknown so I cant do just a croping function that removes the last couple dig


Silly question (Rounding) -
Have searched as always but it appears all the rounding done if for numbers like 10.34354 etc I need to round off to the nearest 10 but not least, example 10 would stay as 10 11 would be 20 3 would be 10 22 would be 30 Thanks in advance


...............Desparate now...(beginner stuck) -
I posted a similar question yesterday. Thanks to the guys who replied, but I didn't explain myself properly. I have a number which has been input by the user. Could be anything, but normally not greater than about 10 or so, but may be up to 2 decimal points. From this number, I nee


Checking number of dec.places -
with regards to a thread that I posted earlier dealing with rounding down - I found the following formula for achieving this : tempcalc = int(tempcalc * 100 + 0.5) / 100 if tempcalc = 0.016 - u get 0.02 if tempcalc = 0.015 - u get 0.01 which is the result I wanted. Furt


Return an Integer with no decimal without rounding! -
How do i do what the subject sayz? "Return an Integer with no decimal without rounding!"


Rounding a number -
I would like to round off a number to 4 decimal places 13.58386104 What I'm looking for is 13.5839 Thank you


rounding and truncating help pls -
This is probably a common question but I can't find the answer. How do I round up my numbers allways. 4 4.1 4.2 4.5 4.75 4.844 need all to = 5 except when no decimal where it will = 4. VB6 ----- Thanks in advance.


Two simple Format questions -
Hey all, 1) Would anyone help me figure out how to use the format command to force a certain number of places after the decimal? for example: I want '0.03' to format to '0.030000' ... This is what I thought would work: calc = Format(val(calc), "0.000000") Ho


Rounding - Does it or doesn't it -
I've seen a few comments on this forum that suggest the round function only rounds to the nearest even number. Is this really the case? I've tried a few experiments and, for me at least, this doesn't appear to be true. ie: round(10.6) produces 11 (not even!) print round (11.12


[2008] Rounding to the nearest half (0.5) -
Hey guys, I am reading the temperature of a device and the values are rounding to 1 decimal place. For example, right now it's 13.8 degrees. What I want to do is round to the nearest half of a degree, so using the 13 degree mark as an example:13.1, round to 13.0 13.2, round to 13.0


Handling Decimal Numbers with over 28 decimal places -
Hi I'm trying to handle decimal numbers with over 28 decimal places but the decimal data type is only capable of handling number upto 28 decimal places. What do i have to do in order to accomplish what i want. For example: 300 / 23 = 13.043478260869565217391304347836 but a d


Help: Rounding problem ! -
Hi, I have an application and that give me rare rounding problem. The statement I use to rounding the value x = x + round((w * y), 2) it loop through 4 records, only two record get rounded corrrectly and the other two is not, I have no idea why. Original value Aft


Textbox Format Help -
Hello everyone, I'm rather new to programming and am currently creating my first program. It is a program to give to my client and allow them to calculate a price based on several variables. I currently have the price set to appear in a textbox named txtPrice once a "Get Price


I Need A Number Rounding Fuction -
Hi Has anyone got a function to email to me that rounds a floating point number to a certain number of decimal places. The built in VB Round() function has bugs. I read somewhere on this site that is you round 3.45 to 1 decimal place, it will make it 3.4 rather than 3.5 Thi


Double to String - how do I stop rounding -
I'm writing a conversion program that requires a fairly high degree of accuracy. I am trying to information about a raster dataset in order to make a header file for an ER Mapper raster. The problem is this, some of the numbers refuse to print out as they actually are. For example: I


Money or Decimal -
I am setting up a new database where I need to set fields for prices and costs. I am used to set these fields as Decimals ( ex 10,3 to control rounding) in the meantime I always questioned whether I should use money instead. Can anybody advise on the different advantages and the pr


Hundredth rounding in Euro Conversion -
Using Double variable to store numbers from math formulas, I'm not able to get the correct rounding from national currency to EURO. That is, when the result is, for instance, 37.42500 I should have my variable (formatted with ##0.00) equals to 37.43 . Instead, I get 37.42 that is wron