INTERACT FORUM

Please login or register.

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

Author Topic: How do I right justify numbers in a column?  (Read 3770 times)

magnust

  • Galactic Citizen
  • ****
  • Posts: 380
How do I right justify numbers in a column?
« on: December 28, 2013, 07:49:09 am »

Can't find how I change from left to right justified in a column? It's much easier to read at a glance if it's right justified  :)

Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: How do I right justify numbers in a column?
« Reply #1 on: December 28, 2013, 07:50:39 am »

You can't, and I really think it hurts Media Center's presentation.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How do I right justify numbers in a column?
« Reply #2 on: December 28, 2013, 12:12:50 pm »

Here's a way to help right align:

    http://yabb.jriver.com/interact/index.php?topic=79378.msg539564#msg539564

It is not perfect, but works reasonably well with fields of known size constraints.  You'll have to format your own dB values from the raw field.
Logged
The opinions I express represent my own folly.

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10942
Re: How do I right justify numbers in a column?
« Reply #3 on: January 02, 2014, 06:20:37 am »

In the next version of MC, all numeric columns will be right aligned.
Logged
~ nevcairiel
~ Author of LAV Filters

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: How do I right justify numbers in a column?
« Reply #4 on: January 02, 2014, 06:34:27 am »

In the next version of MC, all numeric columns will be right aligned.
Awesome, thanks!
Logged

DoubtingThomas

  • Citizen of the Universe
  • *****
  • Posts: 564
Re: How do I right justify numbers in a column?
« Reply #5 on: January 02, 2014, 10:49:43 am »

In the next version of MC, all numeric columns will be right aligned.

Great!   It that the next v19 build?
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72444
  • Where did I put my teeth?
Re: How do I right justify numbers in a column?
« Reply #6 on: January 02, 2014, 10:57:08 am »

Yes.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10942
Re: How do I right justify numbers in a column?
« Reply #7 on: January 02, 2014, 10:58:21 am »

I suppose I should've said "in the next build" instead, but yeah  ;D
Logged
~ nevcairiel
~ Author of LAV Filters

phalanthus

  • Galactic Citizen
  • ****
  • Posts: 461
Re: How do I right justify numbers in a column?
« Reply #8 on: January 03, 2014, 12:27:32 am »

 ;D ;D ;D ;D ;D ;D ;D
Logged

magnust

  • Galactic Citizen
  • ****
  • Posts: 380
Re: How do I right justify numbers in a column?
« Reply #9 on: January 03, 2014, 06:54:54 am »

Nice!

 :)
Logged

ksvane

  • World Citizen
  • ***
  • Posts: 124
Re: How do I right justify numbers in a column?
« Reply #10 on: January 04, 2014, 05:39:51 am »

Aesthetically, I liked it better the old way. Now, having a numeric column next to one with text looks hideous. Why not make it customizable?
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10942
Re: How do I right justify numbers in a column?
« Reply #11 on: January 04, 2014, 05:47:38 am »

A couple people brought that up now, and I guess its just a matter of personal preference.
Ideal would be a number rendering mode which aligns all the numbers perfectly, but does so without right-aligning, but I guess thats just an impossible task to pull off.

We're thinking about making it configurable. Not sure how yet. Maybe per-column, maybe a global setting.
Logged
~ nevcairiel
~ Author of LAV Filters

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: How do I right justify numbers in a column?
« Reply #12 on: January 04, 2014, 06:44:02 am »

Aesthetically, I liked it better the old way. Now, having a numeric column next to one with text looks hideous. Why not make it customizable?
but for now, you can use an expression to lineout left. take for instance track#, when using [Track #] it will line out left.

 :)
gab
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72444
  • Where did I put my teeth?
Re: How do I right justify numbers in a column?
« Reply #13 on: January 04, 2014, 07:30:40 am »

Aesthetically, I liked it better the old way. Now, having a numeric column next to one with text looks hideous. Why not make it customizable?
Would a space or two after the number help?
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: How do I right justify numbers in a column?
« Reply #14 on: January 04, 2014, 09:40:35 am »

I have been pushing for this ever since I started using Media Center, so I'm really happy to see it implemented.
 
Aesthetically, I think it's a big improvement overall - but there is still some room for improvement.
 
If a column is right-aligned, it seems like the header should be too.
 
 
For fields like Track #, it might read better if there is a period (and maybe a space?) after the number.
 
1.  Track Name reads better than 1 Track Name
 
 
For expressions, such as listitem([Peak Level (R128)],0), everything is still being left-aligned, and it would be nice to have some way of changing this even if it's not automatic.
 
 
I still feel that Media Center should be displaying an actual minus character rather than a hyphen for negative values to fix their alignment.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10942
Re: How do I right justify numbers in a column?
« Reply #15 on: January 04, 2014, 09:51:38 am »

Expressions are fixed in the next build, as long as you set their datatype, so ie. listitem([Peak Level (R128)],0)&DataType=[Number] will render properly right-aligned as a number.

Regarding the minus, even the actual minus does not line up perfectly with the +, and the hypen looks better (ignoring the alignment), IMHO anyway, but with right-alignment that shouldn't be a problem anymore.
Logged
~ nevcairiel
~ Author of LAV Filters

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: How do I right justify numbers in a column?
« Reply #16 on: January 04, 2014, 11:30:51 am »

Expressions are fixed in the next build, as long as you set their datatype, so ie. listitem([Peak Level (R128)],0)&DataType=[Number] will render properly right-aligned as a number.
Thanks, thatʼs easy enough to change.

Regarding the minus, even the actual minus does not line up perfectly with the +, and the hypen looks better (ignoring the alignment), IMHO anyway, but with right-alignment that shouldn't be a problem anymore.
Thatʼs true—as long as they are right-aligned, it should no longer be an issue.
They do line up though—the minus character is the exact same width as a plus. It just looks out of place if youʼre used to seeing a hyphen.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How do I right justify numbers in a column?
« Reply #17 on: January 04, 2014, 01:22:07 pm »

Consider supporting the older HTML text align attribute:

   align="left|right|center|justify"
Logged
The opinions I express represent my own folly.

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10942
Re: How do I right justify numbers in a column?
« Reply #18 on: January 04, 2014, 01:24:09 pm »

That could get ugly, since the html tags can be at multiple places in an expression. Not sure how to really deal with this.
To be honest, any alignment property inside the field itself would suffer from this.

At first i thought about an expression property similar to &datatype, but it has the same problem.
Logged
~ nevcairiel
~ Author of LAV Filters

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How do I right justify numbers in a column?
« Reply #19 on: January 04, 2014, 01:26:54 pm »

Exactly.

This also provides a solution for folks who want to recreate the capabilities of the special Album custom group by header.  They can then add elements to an expression to right-justify some components:

   [Album] by [Artist]<font align="right">[Date]<//font>

Numeric justification can be done by field width and padding in these situations.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How do I right justify numbers in a column?
« Reply #20 on: January 04, 2014, 01:28:34 pm »

I responded quickly after you, so our conversation may seem disjoint.

At first i thought about an expression property similar to &datatype, but it has the same problem.

To me, datatype and alignment are entirely independent, and should be divorced (although smart defaults based on datatype is fine).
Logged
The opinions I express represent my own folly.

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10942
Re: How do I right justify numbers in a column?
« Reply #21 on: January 04, 2014, 01:31:05 pm »

Oh, I was hoping to be fast enough since the problem occured to be in the moment i clicked post and then had to edit. ;)

It would seem to be a good solution to the problem, I wonder however if the text renderer is smart enough to pull it off.
Logged
~ nevcairiel
~ Author of LAV Filters

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: How do I right justify numbers in a column?
« Reply #22 on: January 04, 2014, 01:31:41 pm »

...I wonder however if the text renderer is smart enough to pull it off.

If not, Hendrik is.
Logged
The opinions I express represent my own folly.

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10942
Re: How do I right justify numbers in a column?
« Reply #23 on: January 04, 2014, 01:35:38 pm »

Well, simple cases like <font align="left">[Field]&DataType=[Numeric]<//font> are one thing, but a combination of left and right, and maybe even center..

I guess something to research!
Logged
~ nevcairiel
~ Author of LAV Filters
Pages: [1]   Go Up