mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #12722 from calixteman/printf
JS -- fix printd issue with negative number
This commit is contained in:
commit
85ab53fef0
2 changed files with 7 additions and 2 deletions
|
@ -154,9 +154,9 @@ class Util extends PDFObject {
|
|||
let decPart = "";
|
||||
if (cConvChar === "f") {
|
||||
if (nPrecision !== undefined) {
|
||||
decPart = (arg - intPart).toFixed(nPrecision);
|
||||
decPart = Math.abs(arg - intPart).toFixed(nPrecision);
|
||||
} else {
|
||||
decPart = (arg - intPart).toString();
|
||||
decPart = Math.abs(arg - intPart).toString();
|
||||
}
|
||||
if (decPart.length > 2) {
|
||||
decPart = `${decimalSep}${decPart.substring(2)}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue