VB rounding error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alexmason86
    New Member
    • Oct 2007
    • 9

    VB rounding error

    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

    i.e.

    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?
  • YarrOfDoom
    Recognized Expert Top Contributor
    • Aug 2007
    • 1243

    #2
    Maybe try txtCoGZ.text = str(dblCGZ)?

    Yarr

    Comment

    Working...