combmag-zz / jquery-formatcurrency

Automatically exported from code.google.com/p/jquery-formatcurrency
GNU Lesser General Public License v3.0
2 stars 0 forks source link

dropDecimals argument is not in the code #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
tried using the dropDecimals argument, but it didn't work. Looked into the
code, and it doesn't seem to be defined at all.

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

Thanks!

Original issue reported on code.google.com by max.chir...@gmail.com on 6 Jul 2009 at 10:45

GoogleCodeExporter commented 9 years ago
Change the line

  num = num + settings.decimalSymbol + cents;

with

if (!settings.dropDecimals){
  num = num + settings.decimalSymbol + cents;
}

Original comment by jbgime...@lavinia.tc on 16 Jul 2009 at 2:45

GoogleCodeExporter commented 9 years ago
That works. But what's the difference between the regular js file and the 
pack.js?
Because the last one doesn't have that line at all.

Original comment by max.chir...@gmail.com on 16 Jul 2009 at 7:11

GoogleCodeExporter commented 9 years ago
@max.chirkov: It's there, it's just that all the spaces have been squeezed out 
(i.e. 
minimized).  Look for

  num=num+settings.decimalSymbol+cents;

at the end of line 8 and replace with

  if(!settings.dropDecimals){num=num+settings.decimalSymbol+cents;}

Original comment by Neil.Las...@gmail.com on 12 Aug 2009 at 9:59

GoogleCodeExporter commented 9 years ago
Actually, the code you want in the packed version is this:

     j=j+e.decimalSymbol+g;

And it needs to be changed to this:

     if(!e.dropDecimals){j=j+e.decimalSymbol+g};

Original comment by crunchyb...@gmail.com on 10 Sep 2009 at 5:18

GoogleCodeExporter commented 9 years ago
The dropDecimal feature is to be replaced by the roundToDecimals = 0 feature

Original comment by bdewe...@hotmail.com on 29 Oct 2009 at 7:37

GoogleCodeExporter commented 9 years ago
In the packed version (jquery.formatCurrency-1.1.0.min.js) the option is
roundToDecimalPlace. 
Example: 
myInput.formatCurrency({ roundToDecimalPlace: 0 });

Original comment by brh...@gmail.com on 16 Nov 2009 at 8:12