File: 020140404~46c12ef.patch

package info (click to toggle)
less.js 1.6.3~dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,240 kB
  • sloc: sh: 128; makefile: 35; perl: 11
file content (24 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: reworked internal decimal rounding function
Origin: upstream, https://github.com/less/less.js/commit/46c12ef
Author: seven-phases-max <seven.phases.max@gmail.com>
Forwarded: yes
Last-Update: 2015-10-09

--- a/lib/less/functions.js
+++ b/lib/less/functions.js
@@ -718,13 +718,8 @@
 }
 
 tree.fround = function(env, value) {
-    var p;
-    if (env && (env.numPrecision != null)) {
-        p = Math.pow(10, env.numPrecision);
-        return Math.round(value * p) / p;
-    } else {
-        return value;
-    }
+    var p = env && env.numPrecision;
+    return (p == null) ? value : +(value + 2e-16).toFixed(p);
 };
 
 tree.functionCall = function(env, currentFileInfo) {