Question: I've continued trying different variations of number\_format and float on a certain column in my blade template, but no matter what I still end up with numbers like 514.238054 instead of 514.24

I'm currently using this format:

```
{{ (number_format((float)$item['test']['category'], 2, '.', '')/number_format((float)$item['new']['category'], 2, '.', ''))*100 }}

```

Is there another method I can try with this that would keep it down to two decimal places properly?

Answer: 
It's the result you should format, not the dividend or the divisor.

So if anything it should look something like this

```
{{(number_format(((float)$item['test']['category']/(float)$item['new']['category']), 2, '.', '')) * 100}}

```
**This Php Code Works Just Fine For Above Explained Task!
I've Tried It On My Php Ide!**

**Actual Code:**

```

$flo= 514.238054;

echo number_format((float)$flo, 2, '.', ''); 

```

**Ide Screenshot Before Execution:**

[Before Execution Code](https://i.stack.imgur.com/PF0IT.png)

**Output Ide Screenshot:**

[After Executing The Code](https://i.stack.imgur.com/Npjk8.png)