I am doing an equation and the outcome is 45.454545454545454545.

I would like to get rid of the 45454545 after the decimal point. and have 45%


you need to use the PHP int() function:

$integer = (int)$final;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.