473,396 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

how to round of invoice total round of decimal invoice total 123.44 need show round

invoice total 123.44 so grand total 123 and round off colom -44
also invoice total 123.55 round 124 and roundup +45
Jul 22 '17 #1
3 1991
Cint(variable) will round the value
(cint(variable) - variable) will show the amount of rounding
Jul 31 '17 #2
83rock
2
VB6 CInt and CLng us the bankers rounding for .5, and rounds to the nearest even number.
CInt(123.5) and CInt(124.5) both produce the same result, with different rounding
CInt(123.5) :and CInt(124.5) both produce the same result, with
Aug 1 '17 #3
83rock
2
VB6 CInt and CLng both use the bankers rounding for .5, rounding to the nearest even number.
Hence CInt(123.5) and CINT(124.5) will produce the same result (with different round Up/Down):
CInt(123.5) = 124 Round Up 0.5
CINT(124.5) = 124 Round Off -0.5
VB6 Round() also uses bankers rounding, but the Round() function is not implemented in a consistent fashion among different Microsoft products
Ref: MSDN Q196652 HOWTO: Implement Custom Rounding Procedures
Which also provides functions for different rounding algorithms.
Aug 1 '17 #4

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

Similar topics

4
by: Rob | last post by:
I haven't a clue how to accomplish this. All the data is in one table. The data is stored by registration date and includes county and number of students brokne out by grade. Any help...
3
by: Matt | last post by:
Anybody noticed that SQL Server rounds up if the value is half way between two rounded values, but C#'s Decimal.Round(Decimal,Int32) rounds to nearest even number? >From MSDN: "When d is exactly...
1
by: CaptainDahlin | last post by:
I know the basics about access reports and putting page totals in the page footers. What I can't figure out is along with the current page total to display the previous page total: At the bottom...
2
by: jenatlim | last post by:
I need to round up the value 1.43534536597848E-05 to 1.435E-05. can anyone help me? Thanks
3
by: Ly Cao | last post by:
Please shine the light, how do you place the total on the last page of the invoice? how do you find out the it is a last page of the detail lines then place the total of the invoice into that last...
1
by: Darrell Braden | last post by:
I have the need to look at a time stamp within a Access record and if that timestamp occures within a specified time frame, I want to rounded up the time to the start of the next business day, if...
1
by: omar999 | last post by:
can someone please tell me how to modify my function to round off to a whole number <% function discount(listedValue) Discount = 0.9 * listedValue End function %> I've tried this but doesnt...
2
by: Sam Susan | last post by:
I have a decimal value 214332.04854. If i round it it will become as 214332 or 214332.0 in double or in float.I want to round & display 2 digits after that point.
1
by: yukiLeong | last post by:
I facing a problem when doing my final assignment. I really no idea for it? Can help me to solve the problem? In audit fees main form contained the subform name table workload. I wish to...
1
by: msilva100 | last post by:
I have a "Total" on a Form of a Invoice amount: $3,000. When I click on the "Total" field of $3000, I would like to see the detail charges that made up the $3,000. 09/15 Charge 1: $1,000 09/20...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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
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
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,...

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.