Solved

round off decimal number in vb 6

Posted on 2009-07-09
2
521 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

777 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