round

How do you round a floating point number in Perl?

How can I round a decimal number (floating point) to the nearest integer? e.g. 1.2 = 1 1.7 = 2 ...

How do I round corners of myapp's icon

In simulator mode, myapp has an icon with round corners, but on real iPhone, the corners arn't rounded. ...

Built in .Net algorithm to round value up to the nearest 10 interval

How to, in C# round up any value to 10 interval? For example, if I have 11, I want it to return 10, if I have 136, then I want it to return 140. I can easily do it by hand return ((int)( number/10))*10 But I am looking for an builtin algorithm to do this job, something like Math.Round(). The reason why I won't want to do by hand is ...

basic php form help (currency display)

You guys were very helpful yesterday. I am still a bit confused here though. I want to make it so that the numbers on the rightmost column are rounded off to the nearest dollar: http://www.nextadvisor.com/voip_services/voip_calculator.php?monthlybill=50&Submit=Submit the code for the table looks like this: I want $offer[1,2,3,...

SQL Rounding Question

I have the following values being returned in a column.. 0.250000 and 13.000000. I'd like to round the 0.250000 up to 1 and leave the 13 as is. Any easy way to do this since they both fall within the same column? ...

round in PHP shows scientific notation instead of full number

I'm trying to do an echo of a variable containing 1400000. so there is written: echo round(1400000); this gives 1,4E+6 instead of the full number. Anybody an idea on how to display it fully? ...

Where is Round() in C++?

Duplicate of: round() for float in C++ I'm using VS2008 and I've included math.h but I still can't find a round function. Does it exist? I'm seeing a bunch of "add 0.5 and cast to int" solutions on google. Is that the best practice? ...

NSTimeInterval to readable NSNumber

NSTimeInterval == double; (e.g. 169.12345666663) How can I round up this double so that there are only 2 digits left after the "dot"? It would be very good if the result is a NSNumber. ...

comparing two double values

I use an acceleration sensor to calculate the current accelerations and it returns the double value. However I would like to compare the current acceleration with value 9.8. Before doing that i have to round the value received from the sensor so the question is: How to round a doble value to a selected number of decimals in .NET? ...

make a button round

hi, im trying to make a JButton round at the (x,y) corrds of (150,210). i want the button to be an oval of the size (40,40). and the buttons background color red. it doesnt need text so i should get a button to what ever size i want right. i am using a panel and i set the setLayout to null setLayout(null) i checked google and it brou...

round number to nearest 0.2 with PHP

I'm creating this rating system using 5-edged stars. And I want the heading to include the average rating. So I've created stars showing 1/5ths. Using "1.2" I'll get a full star and one point on the next star and so on... But I haven't found a good way to round up to the closest .2... I figured I could multiply by 10, then round of, and...

Why does Spreadsheet::XLSX::Utility2007's xls2csv round off to two decimal places?

I am writing a Perl/Tk script which displays Excel worksheets using the ss2tk example script from the Spreadsheet::Read module. It does not round off two decimal places but the function from Spreadsheet::XLSX::Utility2007 does round off to two decimal places. Why? I'm trying to use that second function as a feature of my program to offer...

SQL through classic ADO - Undefined Function 'Round' ?

I'm working on a legacy product and i have some SQL being executed through ADO, to an Access database with linked tables to SQL Server. I'm getting the error 'Undefined function 'Round' when i execute the SQL but if i take the query and run directly in Access it works fine. I know that EVERYTHING is correct and that this is a machine s...

MySql FLOAT datatype and problems with more then 7 digit scale

We are using MySql 5.0 on Ubuntu 9.04. The full version is: 5.0.75-0ubuntu10 I created a test database. and a test table in it. I see the following output from an insert statement: mysql> CREATE TABLE test (floaty FLOAT(8,2)) engine=InnoDb; Query OK, 0 rows affected (0.02 sec) mysql> insert into test value(858147.11); Query OK, 1 row ...

Round speedometer with Jquery / CSS in a browser

I need to make a round object much like a speedometer (with moving needle inside indicating a value) in a browser. currently for all other items on this page iam using jquery. I rather not use flash as it needs to be ipod / iphone usable. Any experience others have had doing this is greatly appreciated. ...

Round Corner (css and javascript)

please go to : http://jlecologia.com/page1c.html to see the problem the top box look fine.. but in ie6 there is a double top and bottom border... can somebody point me ut what i have done wrong ?.. Or can anybody tell me a javascript rounded box that accept to do that effect with the border that is unequal. I have test some and they a...

jQuery round corner code for IE8 in standards mode?

I need a solution for round corners using javascript with or without jQuery in IE8 standards mode. ...

SQL Round function not working, any ideas?

Here is the SELECT statement: SELECT ROUND(ISNULL(SUM(Price),0),2) As TotalPrice FROM Inventory WHERE (DateAdded BETWEEN @StartDate AND @EndDate) Any ideas of why it's not rounding to two decimal places? ...

SQL Round Function

round(45.923,-1) gives a result of 50. Why is this? How it is calculated? (sorry guys i was mistaken with earlier version of this question suggesting value was 46) ...

Rounded Corner box using CSS with Nifty not Working, help me

Im trying to put a rounded rectangle using Nifty technique. But not working help me. My Code is Below st.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/ht...