Question: I need format a decimal number on JavaScript, my number are returning 100.000 but I want 100,00.

```
var val = 100.0000;
console.log(val);
// do something
console.log(val);

```

> 
> what I get: 100.0000  
> 
>  what I expected: 100,00
> 
> 
> 

what I need to do for made this?

Answer: 
One possible solution: 

```
parseFloat(val).toFixed(2).replace('.', ',');

```

See in action: [JSFiddle](http://jsfiddle.net/bs9va6es/)
It depends on the need. I suggest to have a look to the formatting methods of [`Number.prototype.toLocaleString`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString).

```js
var val = 100.0000;
document.write(val.toLocaleString('de-DE', { maximumFractionDigits: 2, minimumFractionDigits: 2}));
```