Poll

Problem with formatCurrency?

Problem with formatCurrency using negative numbers
0 (0%)
negative numbers and formatCurrency
0 (0%)

Total Members Voted: 0

Author Topic: formatCurrency  (Read 2132 times)

[email protected]

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 4
    • View Profile
formatCurrency
« on: July 02, 2015, 10:16:30 pm »
allways return positive value even when the original value is negative

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5245
    • View Profile
Re: formatCurrency
« Reply #1 on: July 03, 2015, 12:15:30 am »
it always returns positive value so that custom prefix can be applied easily.

return ((value < 0) ? "-" : "") + "$" + $.paramquery.formatCurrency( value );