I have a float value for the ng-model that I would like to always display with 4 decimal places in the <input>:
<input type="number" name="myDecimal" ng-model="myDecimal | number : 4" />
答案 0 :(得分:0)
You can use value attribute of input type.
<input type="number" name="myDecimal" ng-model="myDecimal" value="myDecimal | number : 4" />
答案 1 :(得分:0)
You can use public function ajaxDeleteItemAction(Request $request)
{
if($request->isXmlHttpRequest()){
$id = $request->get('entityId');
$em = $this->getDoctrine()->getManager();
$evenement = $em->getRepository("TunisiaMallBundle:Evenement")-
>find($id);
$em->remove($evenement);
$em->flush();
return new JsonResponse('good');
}
}
to handle decimal points. You can use fraction to determine the number of decimal places. By default it is 2.
For more details ng-currency
ng-currency
var app = angular.module('plunker', ['ng-currency']);
app.controller('ApplicationController', function($scope) {
$scope.amount = 0.431264;
});
答案 2 :(得分:0)