GTITC
GTITC

Reputation: 139

AngularJS currency format issue

Having a problem not being able to show a number like this 40.70, It's showing as 40.7

I tried adding {{number:2}} to different places but just can't get it to work. Any help is greatly appreciated.

this is my current html code:

<td style="width: 10px;">
                        <div class="currency-input">
                            <span class="currency-symbol">$</span>
                            <input type="number" step="0.01" min="0.00" class="currency" ng-model="item.UnitPrice" ng-change="updateQuoteTotals(); formatDecimals(this)" class="form-control text-center input-sm" style="width: 90px; border: 1px solid #CCCCCC; height: 25px;" readonly>z
                        </div>
                    </td>

I know I have to add {{number:2}} somewhere in there just don't know where.

Upvotes: 1

Views: 218

Answers (2)

trees_are_great
trees_are_great

Reputation: 3911

I think what you want is {{40.70 | currency}}

Upvotes: 1

Narek Mamikonyan
Narek Mamikonyan

Reputation: 4611

Try like this it should vork

<input type="text" ng-model="val | number:2">

Upvotes: 1

Related Questions