Format of <Size> variables

Ideas for improvements and requests for new features in XnView Classic

Moderators: helmut, XnTriq, xnview

Post Reply
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Format of <Size> variables

Post by XnTriq »

For thumbnail labels & tooltips as well as HTML output and the information shown in fullscreen mode I prefer the <Size> over the <Size KB> variables.

My request would be that the values for <Size> are formatted as 1.234.567 bytes rather than 1234567 bytes to make them easier to read.
User avatar
ouistiti
Posts: 353
Joined: Mon Oct 25, 2004 7:28 pm
Location: Belgique
Contact:

Post by ouistiti »

:arrow: XnTriq
I prefer the <Size> over the <Size KB>
I prefered <Size Kib> : see here
<Size> are formatted as 1.234.567 bytes rather than 1234567 bytes
Why not 1,234,567 ? or 1 234 567 the only international admitted !

Friendly :wink:

Paul
L'important n'est pas de convaincre, mais de donner à réfléchir.
The important thing is not to convince, but to incite to think.

1,77245385090552...
User avatar
Clo
XnThusiast
Posts: 4441
Joined: Sun Oct 17, 2004 4:57 am
Location: Bordeaux, France
Contact:

Agree !

Post by Clo »

—> ouistiti

:) Hello Paul !

• Indeed, the ouistiti Prof of Maths is right ! I agree ! :P

- In Total Commander, we have the advantage to choose the units (and the capability to correct the wrong ones) ! …

:mrgreen: Friendly,
Claude
Clo
Old user ON SELECTIVE STRIKE till further notice
User avatar
foxyshadis
Posts: 395
Joined: Sat Nov 18, 2006 8:57 am

Post by foxyshadis »

I assume 1.234.567 is your system default locale style, right? In that case, what would be a much simpler way to please all (most?) users is to just run the number part through GetNumberFormat:

sprintf(sTemp,"%d",size);
GetNumberFormat(LOCALE_USER_DEFAULT,0,sTemp,NULL,sFormatted,sizeof(sFormatted));
sprintf(sOut,"Size: %s",sFormatted);

iirc...

Some might prefer plain numbers, but then again, that's what the locale settings are there for.

[btw, I mean this for all numeric values, not just that one, of course.]
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

Thanks for your comments, guys.
ouistiti wrote:
I prefer the <Size> over the <Size KB>
I prefered <Size Kib> : see here
I know you do. :mrgreen:
One of the main reasons why I'm always going for bytes is to avoid the confusion caused by conflicting interpretations of kilobyte.
ouistiti wrote:
<Size> are formatted as 1.234.567 bytes rather than 1234567 bytes
Why not 1,234,567 ? or 1 234 567 the only international admitted !
Well, a look at your forum signature tells me that you would opt for commas as decimal separator (and probably blank spaces to separate every third digit), while my instincts tell me that it's not a very good idea to get into an argument over numbers (or number formatting) with our resident math professor. :wink:

When I posted my request I had no one particular style in mind. Any marker — be it period, comma or apostrophe — would improve readability.
foxyshadis wrote:In that case, what would be a much simpler way to please all (most?) users is to just run the number part through GetNumberFormat:
This is exactly what I'm after! <Size> & <Size KB> should be formatted according to the user's system locale settings.

But in addition to that I'd like to be able to customize <Size[]> & <Size KB[]> with a syntax scheme (like the one for <Date>) which overrides the system defaults. Especially for “Web page Create” that should come in handy, don't you think?

Code: Select all

<Filename With Ext>                           image.bmp
<Width>×<Height>×<BPP> · <Size [#'###'###]>   1024×768×24 · 2'359'350
<Modified Date [d/b/Y H:M:S]>                 30/Feb/2007 20:07:30
Forum references:Off-site resources:
User avatar
foxyshadis
Posts: 395
Joined: Sat Nov 18, 2006 8:57 am

Post by foxyshadis »

I had no idea you could do that for date! How cool. I always think allowing customizability like that is a good idea, so I would get behind it, especially since the parser's already there. My suggestion was only to give better defaults.
Post Reply