Christopher Blue 0 Posted January 2, 2005 I wish to round a floating point off to one decimal place but I wish to have a floating zero. What is the best way to do this? Share this post Link to post Share on other sites
Christopher Blue 0 Posted January 2, 2005 Crap...thread title should say "floating" instead of "leading". Share this post Link to post Share on other sites
CyberSlug 6 Posted January 2, 2005 Seems to work... $float = .71828 $rounded = Round($float, 1) MsgBox(4096, "Answer", $rounded) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Share this post Link to post Share on other sites
Christopher Blue 0 Posted January 2, 2005 Yes but Round doesn't pad a zero. I need to pad a zero. Share this post Link to post Share on other sites
CyberSlug 6 Posted January 2, 2005 Ohhh, is this what you want?: $float = 1.00001 $rounded = Round($float, 1) If Not StringInStr($rounded, ".") Then $rounded = $rounded & ".0" MsgBox(4096, "Answer", $rounded) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Share this post Link to post Share on other sites
Christopher Blue 0 Posted January 2, 2005 That's a good way of doing it! Thanks CyberSlug! Share this post Link to post Share on other sites