Solved

round off decimal number in vb 6

Posted on 2009-07-09
2
519 Views
Last Modified: 2013-11-25
I want to round off..........not exactly round off.it should be trim.
I have a number:2.05012413. I want make it 2.0501. It should have only four digits after decimal.
how do I do it in Vb6?
0
Comment
Question by:SGUDAPAT
2 Comments
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 500 total points
ID: 24815504
If this is for display purposes, you can convert it to a string with Format

Format$( MyDecimalValue, "0.0000" );

If you want to actually change the value to round off to 4 decimals, use the Round function

MyDecimalValue = Round( MyDecimalValue, 4 )
0
 
LVL 1

Author Closing Comment

by:SGUDAPAT
ID: 31601665
Thank you.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now