Remove last character from a variable and then multiply against another variable

Posted by Thomas on Stack Overflow See other posts from Stack Overflow or by Thomas
Published on 2010-04-19T16:32:46Z Indexed on 2010/04/19 16:43 UTC
Read the original article Hit count: 253

Filed under:
|
|

I have a whole bunch of percentages stored as XX% (e.g. 12%, 50%, etc..) I need to remove the percentage sign and then multiply the percent against another variable thats just a number (e.g. 1000, 12000) and then output the result. Is there a simple way to strip the percentage sign and then calculate the output with PHP? Or should I consider some sort of JS solution?

© Stack Overflow or respective owner

Related posts about math

Related posts about php