Author Topic: Question about $.paramquery.formatCurrency function  (Read 5313 times)

noctrona

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
Question about $.paramquery.formatCurrency function
« on: July 01, 2014, 12:39:05 pm »
Hi,

I have question for this method "$.paramquery.formatCurrency()", it looks like the digital value handle by method will only left one decimal.

Is that possible to left two decimal by this function?


Thank you!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Question about $.paramquery.formatCurrency function
« Reply #1 on: July 02, 2014, 01:04:01 am »
Currently $.paramquery.formatCurrency() adds only one decimal,

you could use this function to add 2 decimal places:

parseFloat(ui.cellData).toFixed(2)

noctrona

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
Re: Question about $.paramquery.formatCurrency function
« Reply #2 on: July 02, 2014, 07:46:46 am »
Currently $.paramquery.formatCurrency() adds only one decimal,

you could use this function to add 2 decimal places:

parseFloat(ui.cellData).toFixed(2)

Hi,

Thanks for your answer. But is that possible format my cell value as currency and also have two decimal directly?
For the moment, I use the following way to achieve this effect:

Code: [Select]
return ((ui.cellData > 0) ? $.paramquery.formatCurrency(ui.cellData)+'0' : '');

Add a "0" string to the return value.
« Last Edit: July 02, 2014, 08:05:03 am by noctrona »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Question about $.paramquery.formatCurrency function
« Reply #3 on: July 02, 2014, 10:33:06 am »
Noctrona

You are doing the right thing by appending 0.

More formatting options would be added to formatCurrency in next version probably 2.1.2

noctrona

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 82
    • View Profile
Re: Question about $.paramquery.formatCurrency function
« Reply #4 on: July 03, 2014, 11:02:45 am »
Noctrona

You are doing the right thing by appending 0.

More formatting options would be added to formatCurrency in next version probably 2.1.2


Thank you!