Doing this preserves the form validation that ensures that
the user cannot submit the form with a non-numeric amount.
This does lose forcing the display of default amounts such as
"1.50" to two decimal places, but I'm figuring that form validation
takes priority pending a longer-term solution such as a custom
value validator or using ng-currency.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
<div class="form-group">
<label for="bill-dialog-amount" class="control-label col-md-4">[% l('Amount:') %]</label>
<div class="col-md-8">
- <input type="string" min="0" step="any" class="form-control"
+ <input type="number" min="0" step="any" class="form-control"
focus-me='focus' ng-required="true" id="bill-dialog-amount"
ng-model="billArgs.amount"/>
</div>
var type = billingTypes.filter(function(t) {
return t.id() == $scope.billArgs.billingType })[0];
if (type.default_price()) {
- $scope.billArgs.amount = parseFloat(type.default_price()).toFixed(2);
+ $scope.billArgs.amount = parseFloat(type.default_price());
} else {
$scope.billArgs.amount = null;
}