Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Decimal places in vb6
Name: Ant Arde Date: August 25, 2005 at 06:42:41 Pacific OS: win Xp sp2 CPU/Ram: 512
Comment:
Please can someone help me, i need to get the value of AT to two decimal places instead of four thanks ant,ps.. these are all currency variables
amt2 = CCur(Text29.Text) vat = 1.14 AT = amt2 / vat Text30.Text = AT
Name: StuartS Date: August 25, 2005 at 11:06:22 Pacific
Reply:
AT = format(AT,"#0.00")
The zeros ensure that something is printed even if the value is Zero.
AT = 4.2 with produce 4.20
AT = 34.347 with produce 34.35 Format rounds up the the next number.
at = 0 will produce 0.00
You can do the same with the Round function but that ignores trailing zeros.
Stuart
0
Response Number 2
Name: wizard-fred Date: August 25, 2005 at 22:47:17 Pacific
Reply:
A note of caution.
If these rounded values are to be used in subsequent calculations please correct the variables from which they are derived.
If these numbers appear in a financial statement or spreadsheet, can you testify to the accuracy of your work.
As a long time auditor of financial statements and spreadsheets. I have found errors in other peoples work that involved 10's of millions of dollars. It gets very embarassing if you have to retract you work in court or to the SEC. It might cost your company a lot.
Summary: Hi I hope someone could help me. I am using the following equation in Delphi 7.. a:=b*40/47 but i want 'a' to 2 decimal places. I've tried using the FloatToStrF function but could not get it to work. ...
Summary: hi, I am facing a problem in generating crystal report9 in VB6.0.It throws an error"Unable to load report(20525)" the code i used is Private Sub Command1_Click() CrystalReport1.ReportFileName = "C:\An...
Summary: this formula does not give me any decimal places, please can someone help me thanks Ant percent = CInt(label45.caption) amt = CCur(text30.text) ans = (amt \ 100) * percent label1.caption = ans ...