INTERACT FORUM

Please login or register.

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

Author Topic: Decimal place limited to 2 ?  (Read 1320 times)

Raimy

  • Recent member
  • *
  • Posts: 31
Decimal place limited to 2 ?
« on: January 03, 2014, 02:11:51 pm »

Happy New Year folks.  :)

I am finding myself in need of a field which will display at least 4 decimal places, for use in a smartlist. So what about this?

FormatNumber(math(10 / 136),3)&datatype=[number]

Results differ from Library field to expression column. The column gives me what i want, but the library field chops off the last 2 decimal places.

Library Field Output = 0.07
Expression Column Output = 0.0735

Just a quick question on this. Is a Library field limited to 2 decimal places what ever expression i throw at it?
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10937
Re: Decimal place limited to 2 ?
« Reply #1 on: January 03, 2014, 02:23:13 pm »

Simple decimal fields are indeed always limited to displaying 2 decimal places.

If you need to see more, you should be able to do "FormatNumber([Field,0],3])&datatype=[number]" in an expression column.
Note the added ",0" after the field name, it means you get the "raw" unformated data, so you can format it yourself.
Logged
~ nevcairiel
~ Author of LAV Filters

Raimy

  • Recent member
  • *
  • Posts: 31
Re: Decimal place limited to 2 ?
« Reply #2 on: January 03, 2014, 02:42:12 pm »

Thanks very much Hendrik.
Logged

Raimy

  • Recent member
  • *
  • Posts: 31
Re: Decimal place limited to 2 ?
« Reply #3 on: January 03, 2014, 02:54:17 pm »

Sorry, i thought that had worked, well it works without the "&datatype=[number]" part, soon as i add that it resorts back to 2 decimals only.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10937
Re: Decimal place limited to 2 ?
« Reply #4 on: January 03, 2014, 03:13:36 pm »

Are you sure you included the ",0" in the field name?

I tried this in an Expression Column:
FormatNumber([FPS,0],3])&datatype=[number]

FPS is a decimal field, and some files I have will otherwise show 23.98 instead of 23.976
Logged
~ nevcairiel
~ Author of LAV Filters

Raimy

  • Recent member
  • *
  • Posts: 31
Re: Decimal place limited to 2 ?
« Reply #5 on: January 03, 2014, 03:51:18 pm »

This demonstrates my problem really well actually.

I put

"FormatNumber([FPS,0],3])&datatype=[number]" in an expreesion column showing 3 files output =

25
29.883
29.917

Copy & Paste the same expression into a calculated data Library Field. output =

25
29.88
29.92

Iv no idea what's going on here, except forcing the calculated field to number data, also limits the output to 2 decimal places.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10937
Re: Decimal place limited to 2 ?
« Reply #6 on: January 03, 2014, 03:52:31 pm »

Like I said earlier, library fields always output only 2 decimals.
If you want to see more, you need to use an expression column.
Logged
~ nevcairiel
~ Author of LAV Filters

Raimy

  • Recent member
  • *
  • Posts: 31
Re: Decimal place limited to 2 ?
« Reply #7 on: January 03, 2014, 04:07:28 pm »

Ar ok, im assuming its just for display reasons, and any sort MC performs would be done on the raw data.

Thanks for the help.
Logged
Pages: [1]   Go Up