> -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of John Pearson > Sent: Thursday, 20 February 2003 4:04 pm > To: PICLIST@MITVMA.MIT.EDU > Subject: [EE]: Basic programming question, rounding numbers > > > In basic, > How can I round off a Single data type to about 4 or 5 decimal places. I > get > scientific notation and I don't need (want) that much precision. > > Thanks > > John > > > -----Original Message----- > From: Ian McLean [SMTP:ianmclean@OPTUSHOME.COM.AU] > Sent: Thursday, February 20, 2003 5:21 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [EE]: Basic programming question, rounding numbers > > If we are talking about VB, use the Round() function. > > i.e. x = Round(x, 4) > Be aware that VB's Round function does not always work as expected. Check out the MS knowledge base at http://support.microsoft.com/default.aspx?scid=KB;en-us;q196652 for reasons why and some functions to implement different types of rounding. Regards Mike -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu