By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,057 Members | 1,401 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,057 IT Pros & Developers. It's quick & easy.

VB rounding error

P: 9
i have this wierd problem whereby the function works out the number i want just fine, but when it comes to being displayed in a text box


txtCoGZ.text = dblCGZ

it gets completely F'd up

im talking the function returning 221.086067, then the text box display 0.73

i just dont get it. i stepped through the code, it even says the text box = that number and when i switch back to the form display that 221.086 is indeed present and correct. but as soon as i press play it goes back to 0.73

what am i doing wrong here? also how do i format a number to like 2-3 dp? currently im using round, is that ok?
Dec 2 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 1,247
Maybe try txtCoGZ.text = str(dblCGZ)?

Dec 2 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.