Help Answer

June 24, 2009

Visual Basic 6 Round Error

Filed under: Programming — admin @ 6:58 pm

I just hit an interesting error in VB6 today.

I was trying to calculate a distance between two points. No problem there except I didn’t want to put something on a page that said “48.723569″ miles. That would look dumb.

No problem, I thought, I’ll format the output using VB’s format command, giving the number string as “#####0.0″.

But for certain numbers, format kept giving me the answer 0.0

No problem, I’ll use Round instead.

Same error. Some calculations worked, others got rounded to zero regardless… (more…)

Powered by WordPress