Follow via:
RSS
Email Alert
Question
0 Votes
+ -

rounding decimals

I'm using visual basic 6.0 and I cant remeber how to get a number to round to only two places behind the decimal place please help?
Tags: programming
6th Aug 2007

Answers (1)

0 Votes
+ -
Rounding
Try this technique:

n = 45.8768
r = int (n*100)/100
msgbox r
7th Aug 2007
Answer the question
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.