question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

In BONUS:

.maskMoney(‘unmasked’) return a float value (ex.: ‘R$ 1.234,56’ => 1234.56).

The problem is if field with value R$ 1.234 (without cents), return 1.234 but correct is 1234 for R$.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
luneurcommented, Jun 20, 2018

` unmasked: function () { return this.map(function () { var value = ($(this).val() || “0”), isNegative = value.indexOf(“-”) !== -1, decimalPart; // get the last position of the array that is a number(coercion makes “” to be evaluated as false) $(value.split(/\D/).reverse()).each(function (index, element) { if (element && value.indexOf(‘.’) != -1) { decimalPart = element; return false; } }); value = value.replace(/\D/g, “”);

            value = value.replace(new RegExp(decimalPart + "$"), "." + decimalPart);
            if (isNegative) {
                value = "-" + value;
            }
            return parseFloat(value);
        });
    },`

change “ if (element) { ” to "if (element && value.indexOf(‘.’) != -1) { "

2reactions
oorticommented, May 15, 2018

Hi @newerton! Please try instead this https://codepen.io/anon/pen/eRJLWY

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ray Parker Jr. ('The Masked Singer' Sir Bug a Boo) ...
Ray Parker Jr. ('The Masked Singer' Sir Bug a Boo) unmasked interview: 'When y'all need somebody else on this show…who you gonna call?'....
Read more >
The Masked Singer - Sir Bug A Boo / Ray Parker Jr. - FOX
Unmasked Interview: Sir Bug A Boo / Ray Parker Jr. 11-23-2022 • TV-PG • 2m ... Unmasked Interview: Harp / Amber Riley. 12-01-22...
Read more >
Who were the celebrities competing as Scarecrow and Sir Bug ...
Two celebrities are unmasked while one moves on to the next week. “The Masked Singer” host is Nick Cannon. Panelists are Ken Jeong,...
Read more >
Season 8 Ep. 9 | THE MASKED SINGER | singing, Ray Parker ...
Sir Bug A Boo Unmasked Performance | Season 8 Ep. 9 | THE MASKED SINGER. singing · Ray Parker Jr. performance. Who ya...
Read more >
Be careful with bug spray... - Myasthenia Gravis Unmasked
DEET insect repellent has effects on nervous system. New research finds that DEET, one of the world's most common insect repellents affects the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found