妙音 posted @ 2014年8月22日 21:13 in webui with tags angularjs;过滤器;number , 7832 阅读


{{ number_expression | number : fractionSize}}


$filter('number')(number, fractionSize)


  • number 待精确的数字
  • factionSize(可选) 小数点后精确位数,默认值是3.
默认情况下保留的小数位数小于等于3. 比如: 1234-->1234;1234.56789-->1234.568;1234.56-->1234.56)


<!doctype html>
<html ng-app='demo'>
<meta charset='utf-8'>
<div ng-controller="ExampleController">
  输入数字: <input ng-model='val'><br>
  <!-- 默认格式 -->
  默认格式: <span id='number-default'>{{val | number}}</span><br>
  <!-- factionSize=0 -->
  保留0位: <span>{{val | number:0}}</span><br>
  <!--factionSize大于小数点位数 -->
  保留10位: <span>{{val | number:10}}</span><br>
  <!-- factionSize小于小数点位数-->
  保留2位: <span>{{val | number:2}}</span>

<script src="/static/lib/angular/angular.js"></script>
<script src="/static/lib/angular-resource/angular-resource.min.js"></script>
    var app = angular.module('demo', ['ngResource'])
    .controller('ExampleController', function($scope) {
        $scope.val = 1234.56789;
输入数字: 1,234.56789
默认格式: 1,234.568
保留0位: 1,235
保留10位: 1,234.5678900000
保留2位: 1,234.57
research paper write 说:
2022年3月07日 18:54

A number of dissertation websites on the internet online in the event you obtain clearly declared in the website.

ac repair Davie 说:
2022年6月01日 13:57

Broward County AC repair: Parkland, Pompano Beach, Deerfield Beach, Fort Lauderdale & Davie. Satisfaction guaranteed - call Amtek now (855) 585-0219.

office chairs tampa 说:
2022年6月01日 18:24

In today’s rapidly changing office environments, Office Furniture Solutions is uniquely positioned to assist large corporations, small business owners, and homeowners with a broad range of office furniture products that ensure safety while meeting the latest design trends.

societies in islamab 说:
2022年6月01日 20:19

The dream of owning a home is very common but some people achieve their dream by taking the right step at the right time. There are many investment opportunities that are offering the best and affordable housing societies in Islamabad in installments.

humana medicare par 说:
2022年6月01日 21:17

If you’ve been researching Humana Medicare Plans and have found one plan that caught your eye, its likely Humana Medicare Part D. Humana Part D plans are by far some of the most popular in the marketplace for stand-alone coverage and have held that place for some time now. With a Humana Part D Insurance policy, the benefits you receive are plentiful while still managing a low and affordable premium monthly.

innovation transform 说:
2022年6月09日 19:07

Extend the potentials of your technology at STP Platform, where scientific theories and technological development goes beyond physical limitations. Demonstrate the power of your technology in living scenarios. We strive to bridge industry-leading corporates and tech startups amongst our community, unlocking every technology adoption possibility.

家居消毒 说:
2022年6月11日 17:42

第五波疫情肆虐下,大部分人又再展開Work From Home、網課生活,教一眾小市民加倍關注日常家居清潔衛生,以確保家人、小朋友及毛孩健康。除了日常勤洗手、酒精搓手、頻繁更換潔淨衣物及拖地消毒外,亦可以考慮為家居添置最新消毒儀器,幫助室內環境潔淨細菌與病毒。通過嚴格安全檢測、對人體無害的Lumenizer™ 300過濾遠紫外消毒儀,可謂家居潔淨好幫手,能夠全天候快速高效殺菌消毒,締造一個舒適無菌無毒的家園。

dark web/deep web/d 说:
2022年8月09日 15:03

When a web directory sees that you have bid on a particular keyword, it will assign an affiliate link to you. There are web directories that allow you to make money by being listed on as many as 10. dark web links

dark web/deep web/d 说:
2022年8月09日 16:49

The world of the internet has come a long way in the past decade. Sites have become more user friendly and accessible to anyone with an internet connection.  dark web sites

dark web/deep web/d 说:
2022年8月09日 19:18

It is also important to remember that not all sites that offer these services are reputable. If the website is asking for personal information as well as financial information, then you should avoid using that website.  dark web links

dark web/deep web/d 说:
2022年8月09日 23:02

You'll just have to learn how to drive traffic to your website. And how to do that without a website. But that's all you need to do if you're going to be successful. work from home jobs

dark web/deep web/d 说:
2022年8月09日 23:37

Another way that you can start to generate traffic to your website is by creating a forum. Forums are very popular because everyone is interested in something.  affiliate marketing success

AP 10th Social Quest 说:
2022年9月10日 19:37

Social Study is most important students to all students of AP 10th Class, here we have provided the study material with solved question bank for all government and private school TM, EM, UM and HM students in chapter wise from past years old exams and we have provided the AP 10th Social Model Paper 2023 Pdf suggested by subject experts. AP 10th Social Question Paper All BSEAP 10th class regular and private course students can follow the list of chapters under SSC Social Study to practice study material with previous question bank to get a better score in summative assessment (SA) and formative assessment (FA) SA-1, SA-2, FA-1, FA-2, FA-3, FA-4 along with Assignments exams previously called Unit Test-1, Unit Test-2, Unit Test-3, Unit Test-4 and Three Months.

登录 *

loading captcha image...
or Ctrl+Enter