Jump to content

Recommended Posts

Posted (edited)

Yeah, stupid question I know, but my program is displaying 1.5 sometimes, and it needs to put a 0 there, so its 1.50, but I don't know how to do this, I thought about using Round() but thats not working and I didn't see anything in the helpfile on doing this, is there a simple way of doing this? Also checked the Math UDF, didnt see anything.

-thanks R6V2

Edited by R6V2
  • Developers
Posted

Yeah, stupid question I know, but my program is displaying 1.5 sometimes, and it needs to put a 0 there, so its 1.50, but I don't know how to do this, I thought about using Round() but thats not working and I didn't see anything in the helpfile on doing this, is there a simple way of doing this? Also checked the Math UDF, didnt see anything.

-thanks R6V2

Check out StringFormat()

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

Thanks Jos!

Whew! This function has alot of info, it's kinda confusing!

EDIT: Hey Jos, would you mind giving me a example on how to do this, im not really understanding all the stuff in the Remarks, and all the specifications...

Edited by R6V2
Posted

$test = 5.1

StringFormat("%.2f", $test) ;Shows 5.10

Aha! Thats what I was looking for, now im going to read exactly how and why it does that! Thanks WeaponX!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...