472,793 Members | 2,275 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,793 software developers and data experts.

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 1502
Dheeraj Joshi
1,123 Expert 1GB
Use round method available in math class

Take a look here.

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

Dheeraj Joshi
Sep 29 '10 #3

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

Similar topics

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...
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...
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)...
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
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...
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...
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,...
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
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...
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...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: Mushico | last post by:
How to calculate date of retirement from date of birth
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.