473,471 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Create 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 1550
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
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
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
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
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
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
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
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
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
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.