Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Gabotronix's avatar

Remove comma from double integer value

Hi everybody, I'm using Stripe to test making charges, Stripe API make charges in the smallest value posible (in this case it's cents), what I do is transform my original input (euros) to cents like this:

$cents = 2.99 * 100;

Now I want to remove the comma from the result with php, how can I do this?

0 likes
1 reply
Nakov's avatar
Nakov
Best Answer
Level 73

Comma is , so you have no comma in your value. But you can cast the result to an int value:

$cents = (int) (2.99 * 100);

Please or to participate in this conversation.