locbet / jquery-numberformatter

Automatically exported from code.google.com/p/jquery-numberformatter
0 stars 0 forks source link

Numberformatter doesn't format extroardinarily long numbers well #39

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. have a very long number; say 123456789012345678901234567890123456789
2. use the numberFormatter

What is the expected output? What do you see instead?
expected output: either nicely formatted, or, if using scientific notation, 
something like
1,234564456354+38 (or something)
what is given:
1..23.456.789.012.345.68e.+38,00

What version of the product are you using? On what operating system?

Please provide any additional information below.
Sample html:
<html>
<head/>
<body>
<!-- yeah. ensure that these are available... but ok -->
    <script type="text/javascript" src="jquery-uncompressed.js"></script>
    <script type="text/javascript" src="jshashtable-2.1_src.js"></script>
    <script type="text/javascript" src="jquery.numberformatter-1.2.1.js"></script>
    <script>
    $(document).ready(  function() {
        $(".number").each( function() {
            $(this).formatNumber({locale:"de"});
            }
        );
        $(".number").each( function() {
            console.log("element width(chars): " + this.innerHTML.length);
            console.log("element width: " + this.clientWidth );
            }
        );
    } );
    </script>

<div>
<div class="number">12</div>
<div class="number">23000002342342.234</div>
<div class="number" 
style="width:auto">123456789012345678901234567890123456789</div>
</div>
</body>

Original issue reported on code.google.com by witsch...@gmail.com on 28 Feb 2011 at 4:11

GoogleCodeExporter commented 8 years ago
Thanks for pointing this out, I think I will schedule the fix itself to this 
next release (to display/format as non-scientific).

I think if I fix the main problem for this release I can look at having the 
option to have scientific notation fully supported for both parsing and 
formatting, in a couple of releases time.

Original comment by apar...@gmail.com on 25 Apr 2011 at 4:29

GoogleCodeExporter commented 8 years ago
More complex than I initially thought to modify, pushing this back to the 
version after next as an enhancement.

Original comment by apar...@gmail.com on 26 Apr 2011 at 5:33