INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: FormatNumber() removes zeros from decimals  (Read 1517 times)

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
FormatNumber() removes zeros from decimals
« on: December 15, 2017, 06:46:12 pm »

If I use FormatNumber() to specify a number of decimal places, it will remove zeros.
Instead of a list formatted to two decimal places like:

1.23 dB
4.00 dB
5.60 dB

Media Center displays:

1.23 dB
4 dB
5.6 dB

Which can be awkward to read.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: FormatNumber() removes zeros from decimals
« Reply #1 on: December 15, 2017, 09:15:03 pm »

Try adding

&datatype=[number]

and see if it changes anything
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: FormatNumber() removes zeros from decimals
« Reply #2 on: December 15, 2017, 09:22:43 pm »

Doesn't seem to do anything.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: FormatNumber() removes zeros from decimals
« Reply #3 on: December 15, 2017, 10:04:35 pm »

Try [string] instead, maybe it will hold the rounded number

Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: FormatNumber() removes zeros from decimals
« Reply #4 on: December 15, 2017, 10:14:07 pm »

Still nothing.
I think it's an issue with FormatNumber()
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42388
  • Shoes gone again!
Re: FormatNumber() removes zeros from decimals
« Reply #5 on: December 18, 2017, 08:05:21 am »

That's just how it currently works.

But for the next build, we'll try this:
Changed: FormatNumber(...) allows trailing zeroes on decimals (previously it would crop them).
Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up