-
Jun 29th, 2014, 05:17 PM
#1
Thread Starter
Don't Panic!
Formatting numbers...
Hi
Using sprintf atm, but just an observation...
To format a % (ie a number between 0 and 1 eg 0.45) you have to multiply up by 100 and use the code %.0f%% (or something like it).
Why?
Why do I need to multiply up? Doesn't PHP figure that if you add % then the number has to be a percentage and use 0 - 1 as 0 to 100% ?
I had to redo all my values in the table as all it seems to add is the % sign and may be decimal places. Found this really weird.
Another format I am currently looking at is the currency. x,xx0.00 is the format I want...
%0,01.2f
Doesn't work :/ investigating further...
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|