Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit e1d1351

Browse files
committed
Update limitTo to support numbers
It would be nice if limitTo supports numbers. The expected behavior would change input to string and just run limitTo on that value. This becomes useful often when you have long decimal numbers, etc...
1 parent 6d1e7cd commit e1d1351

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ng/filter/limitTo.js

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
*/
7373
function limitToFilter(){
7474
return function(input, limit) {
75+
if (typeof input == "number") input = input.toString();
7576
if (!isArray(input) && !isString(input)) return input;
7677

7778
if (Math.abs(Number(limit)) === Infinity) {

0 commit comments

Comments
 (0)