473,498 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to round float values up at .6 and down if .5 and below

In my case, if the float value is 74.716, it has to rounding into 74.72. But is that value is 74.715, it should be 74.71..

can anyone tel me what rounding ways i need to use?

Thanks in advance
Sep 29 '10 #1
2 1553
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
Use round method available in math class

Take a look here.

Regards
Dheeraj Joshi
Sep 29 '10 #2
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
If this won't work for you. You need to implement your own algorithm.

Regards
Dheeraj Joshi
Sep 29 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2183
by: Casper B | last post by:
"Program to Interfaces, not Implementations" we've all heard, however I now identified a scenario where this idiom can not be used (I think) and is searching for another approach. I have a...
4
1989
by: Kelly Mah | last post by:
Sorry if I got the wrong group. I seem to be running into a rounding issue on a Linux AS2.1 box using gcc 2.95. This program always returns 419 on Linux, but on a Solaris machine, I get the...
3
1630
by: GeRmIc | last post by:
Hello Friends, I am working on a project where the service provider is written in JAVA and the client is written in .NET (C#). The Server communicates with the client through Java Beans. (1)...
5
2732
by: Cygnus | last post by:
Sorry in advance for the lack of formatting in this posting. Data: (column headers) Net Sales | Royalty Rate | Total Royalty (data) 4.31 | 50.00% | 2.15 19.35 | 50.00% | 9.68
4
2385
by: Altman | last post by:
I am having a rounding problem all over the place and am struggling to fix it. My problem is that I have an unit price and a quantity. When I multiply them together they come out to 3.705. I...
3
2190
by: satish mullapudi | last post by:
Hi, I am using DB2 v8.2 & jdk 1.5. I have written a Hello World program in java. Now is it possible to call the HelloWorld program from a stored procedure ? If so, how? I want to catch the result...
0
991
by: kingp | last post by:
Hi all I am trying to execute two JAVA UDFs throough my DB2 SQL stored procedure .These two external routines are performing some critical function which is else not possible.When I try to execute,...
4
3387
by: AMDRIT | last post by:
Given: ?System.Math.Round(161.5D,0) 162.0 ?System.Math.Round(162.5D,0) 162.0 ?System.Math.Round(163.5D,0) 164.0 In either C# '05 or VB.Net '05, can anyone explain the inconsistancy? Is
1
1080
by: Jayanti Patel | last post by:
Hi All, Issue: In SQL Server 2005. Round (2.5) will give -3 Round (-2.5) will give -3 But in Reality the -3 need to be -2. how can we make a custom round function that gives the correct...
2
3166
by: txredraider | last post by:
I am currently using the dsum function to add some fields together given certain criteria. The issue im comining across is this: when the dsum function operates, it automatically rounds the final...
0
7121
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6993
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4899
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4584
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.