# PHP round() question

**URL:** <https://forum.kirupa.com/t/php-round-question/199993>\
**Category:** programming\
**Created:** [September 7, 2006, 8:41pm UTC](https://forum.kirupa.com/t/php-round-question/199993 "2006-09-07T20:41:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sigepmest37](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sigepmest37](https://forum.kirupa.com/u/sigepmest37)\
**Post date:** [September 7, 2006, 8:41pm UTC](https://forum.kirupa.com/t/php-round-question/199993/1 "2006-09-07T20:41:36Z")

</div>

I’ve been trying to come up with a solution to a little PHP round() problem I’m having.

I’m trying to add tax to a subtotal…pretty simple:

```php

$tax= round(($subTotal*.0825),2);

```

Most of the time this works fine, however, on the rare occasion that the tax comes back as a whole dollar or whole 10 cents, it drops the extra 0’s at the end.

Is there a way to check if that has happened and add the necessary 0’s (1 or 2) to the end of the string if needed?

Thanks for the help guys!!!
