Bug 36864 - Calc cell format for Bytes
Summary: Calc cell format for Bytes
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.3.2 release
Hardware: Other All
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Enhancements Calc-Cells
  Show dependency treegraph
 
Reported: 2011-05-05 00:39 UTC by Yehuda Deutsch
Modified: 2017-07-13 10:18 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yehuda Deutsch 2011-05-05 00:39:59 UTC
I think it would be very helpful if these features would be added to the Calc application

1. Add a cell format to recognize data capacity sizes (bit, byte, kilobyte etc.), just like time, phone and others.
2. Recognize lower case 'b' as bit and upper case 'B' as Byte
3. Recognize KB as KiloByte (x1000) and KiB as KibiByte (x1024)
4. when creating a sum function, add the option to choose the display meter (so when the sum is 2,040 KiloBytes, I can choose to display 1.9 MiB or 2,040 KiB)

Thanks for the good job
Yehuda
Comment 1 Muthu 2011-05-05 01:20:36 UTC
kohei->requirements?

I would say, kb for 1000 bits, kB for 1000 Bytes Kb for 1024 bits and KB for 1024 bytes and so on...

It could also be a candidate for EasyHacks. 
Adding a new number format: 
Start code:
svl/inc/nfsymbol.hxx
svl/source/numbers/zforlist.cxx
Comment 2 Don't use this account, use tml@iki.fi 2011-05-05 01:28:40 UTC
oh noes, take cover before the kibibyte crowd notices this bug report.
Comment 3 Kohei Yoshida 2011-05-05 11:35:49 UTC
Actually we don't use prefixes in the title, but prefer whiteboard instead.
Comment 4 Björn Michaelsen 2011-12-23 12:05:10 UTC Comment hidden (obsolete)
Comment 5 Florian Reisinger 2012-08-14 14:03:12 UTC Comment hidden (obsolete)
Comment 6 Florian Reisinger 2012-08-14 14:04:07 UTC Comment hidden (obsolete)
Comment 7 Florian Reisinger 2012-08-14 14:08:40 UTC Comment hidden (obsolete)
Comment 8 Florian Reisinger 2012-08-14 14:10:41 UTC Comment hidden (obsolete)
Comment 9 sasha.libreoffice 2012-09-04 11:44:47 UTC
reopening because it is RFE and easy hack
Comment 10 Joel Madero 2012-11-21 16:57:10 UTC
Marking as NEW as it's a valid request, not sure if it's an EasyHack, someone else can look into that. 

Prioritizing:

Enhancement (already done)

Low - Not much use for the average user but it'd be a nice addition


Regards,
Joel
Comment 11 Michael Meeks 2013-04-03 13:37:04 UTC
In order to make this a real 'easy hack' - we need some code pointers (not terribly hard to create), but we also need some sample number formats for kB etc.

How does that fit into the existing number format syntax ? We can do something like:

[<1000000]0.00," kB";[<1000000000]0.00,," mB";0.00,,," gB"

And create an easy-to-use entry for that. But of course that is all decimal; failing that we would need to extend the number format syntax to handle different bases: something that needs to be done carefully and with a view to standardization.

Either way the code pointers are:

cui/uiconfig/ui/numberingformatpage.ui

and:

cui/source/tabpages/numfmt.cxx

with relevant code in:

svl/source/numbers/zforlist.cxx

It looks like:

i18npool/source/localedata/data/

has locale dependent number formatting entries too, and no doubt Eike has more thoughts here :-)
Comment 12 Eike Rathke 2013-04-04 13:15:14 UTC
Adding a number format code like

[<1000000]0.00," kB";[<1000000000]0.00,," mB";0.00,,," gB"

is certainly possible and would needed only to be done in the locale
data files. Suitable for an EasyHack :-)

Extending the number format syntax to allow different bases is
difficult. While doable in the number formatter itself the problems are:

* There are no means to store this in ODF file format yet, so we'd need
  to come up with a proposal to the OASIS TC.
  * Until accepted we'd need to store such a thing in an extension
    namespace.

* The format codes strive to be compatible with the ones Excel uses and
  are mostly written as is to MS file formats, or with minor conversions
  involved. If Excel does not know such base N feature (I think it does
  not, please correct me if I'm wrong) the format would be lost on
  export / reimport.
Comment 13 Björn Michaelsen 2013-10-04 18:46:10 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 14 Robinson Tryon (qubit) 2013-10-23 18:43:22 UTC Comment hidden (obsolete)
Comment 15 Ayantha Randika 2014-01-25 18:37:09 UTC
I like give this a try. But I dont get "4. when creating a sum function, add the option to choose the display meter (so when the sum is 2,040 KiloBytes, I can choose to display 1.9 MiB or 2,040 KiB)". What is meant from this??
Comment 16 Michael Meeks 2014-01-25 18:53:02 UTC
I'd ignore 4. for now =)
Comment 17 Ayantha Randika 2014-01-25 20:26:17 UTC
Ah OK. Thanks :)


On Sun, Jan 26, 2014 at 12:23 AM, <bugzilla-daemon@freedesktop.org> wrote:

>   *Comment # 16 <https://bugs.freedesktop.org/show_bug.cgi?id=36864#c16>
> on bug 36864 <https://bugs.freedesktop.org/show_bug.cgi?id=36864> from
> Michael Meeks <michael.meeks@collabora.com> *
>
> I'd ignore 4. for now =)
>
>  ------------------------------
> You are receiving this mail because:
>
>    - You are on the CC list for the bug.
>
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>
>
Comment 18 Ayantha Randika 2014-01-25 20:52:51 UTC
Im kind of stuck . There are two lists on this tab and one is category and
its items comes from numberingformatpage.ui. The second list is
format(m_pLbCurrency) and I cant figure out from where it gets its
contents. Can anyone please help?


On Sun, Jan 26, 2014 at 1:56 AM, <bugzilla-daemon@freedesktop.org> wrote:

>   *Comment # 17 <https://bugs.freedesktop.org/show_bug.cgi?id=36864#c17>
> on bug 36864 <https://bugs.freedesktop.org/show_bug.cgi?id=36864> from
> Ayantha Randika <randika.deultima@gmail.com> *
>
> Ah OK. Thanks :)
>
>
> On Sun, Jan 26, 2014 at 12:23 AM, <bugzilla-daemon@freedesktop.org> wrote:
>
> >   *Comment # 16 <https://bugs.freedesktop.org/show_bug.cgi?id=36864#c16> <https://bugs.freedesktop.org/show_bug.cgi?id=36864#c16>
> > on bug 36864 <https://bugs.freedesktop.org/show_bug.cgi?id=36864> <https://bugs.freedesktop.org/show_bug.cgi?id=36864> from
> > Michael Meeks <michael.meeks@collabora.com> *
>
> >> I'd ignore 4. for now =)
> >
> >  ------------------------------
> > You are receiving this mail because:
> >>    - You are on the CC list for the bug.
>
> >
> >> _______________________________________________
> > LibreOffice mailing list
> > LibreOffice@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/libreoffice
> >
> >
>
>  ------------------------------
> You are receiving this mail because:
>
>    - You are on the CC list for the bug.
>
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>
>
Comment 19 Ayantha Randika 2014-01-26 14:44:03 UTC
I played with the code for about 8-9 hours and couldn't figure out how
items in the format list are generated. Can someone give me little help? Is
there a documents I should read to understand the code here?


On Sun, Jan 26, 2014 at 2:22 AM, <bugzilla-daemon@freedesktop.org> wrote:

>   *Comment # 18 <https://bugs.freedesktop.org/show_bug.cgi?id=36864#c18>
> on bug 36864 <https://bugs.freedesktop.org/show_bug.cgi?id=36864> from
> Ayantha Randika <randika.deultima@gmail.com> *
>
> Im kind of stuck . There are two lists on this tab and one is category and
> its items comes from numberingformatpage.ui. The second list is
> format(m_pLbCurrency) and I cant figure out from where it gets its
> contents. Can anyone please help?
>
>
> On Sun, Jan 26, 2014 at 1:56 AM, <bugzilla-daemon@freedesktop.org> wrote:
>
> >   *Comment # 17 <https://bugs.freedesktop.org/show_bug.cgi?id=36864#c17> <https://bugs.freedesktop.org/show_bug.cgi?id=36864#c17>
> > on bug 36864 <https://bugs.freedesktop.org/show_bug.cgi?id=36864> <https://bugs.freedesktop.org/show_bug.cgi?id=36864> from
> > Ayantha Randika <randika.deultima@gmail.com> *
>
> >> Ah OK. Thanks :)
> >
> >> On Sun, Jan 26, 2014 at 12:23 AM, <bugzilla-daemon@freedesktop.org> wrote:
> >
> > >   *Comment # 16 <https://bugs.freedesktop.org/show_bug.cgi?id=36864#c16> <https://bugs.freedesktop.org/show_bug.cgi?id=36864#c16> <https://bugs.freedesktop.org/show_bug.cgi?id=36864#c16>
> > > on bug 36864 <https://bugs.freedesktop.org/show_bug.cgi?id=36864> <https://bugs.freedesktop.org/show_bug.cgi?id=36864> <https://bugs.freedesktop.org/show_bug.cgi?id=36864> from
> > > Michael Meeks <michael.meeks@collabora.com> *
>
> >> >> I'd ignore 4. for now =)
> > >
> > >  ------------------------------
> > > You are receiving this mail because:
> > >>    - You are on the CC list for the bug.
> >> >
> > >> _______________________________________________
> > > LibreOffice mailing list
> > > LibreOffice@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/libreoffice
> > >
> > >
> >>  ------------------------------
> > You are receiving this mail because:
> >>    - You are on the CC list for the bug.
> >
> >> _______________________________________________
> > LibreOffice mailing list
> > LibreOffice@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/libreoffice
> >
> >
>
>  ------------------------------
> You are receiving this mail because:
>
>    - You are on the CC list for the bug.
>
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>
>
Comment 20 Joel Madero 2014-01-26 18:46:30 UTC
Ayantha Randika - couple things

(1) when replying on FDO please come to the website and post, we don't like all the extra stuff that comes with email replies (clogs up the bug report)

(2) for your questions it might be a lot easier to mail the dev list and jump into the IRC channel as then you'll be contacting hundreds of devs not the couple that are on this bug report and likely get hundreds of FDO emails a day
Comment 21 Ayantha Randika 2014-01-28 16:16:11 UTC
Thanks fro the advice. I'm really new here and don't have many experiences using this kind of forums :) thanks.
Comment 22 Eike Rathke 2014-04-24 10:31:31 UTC
This ain't an EasyHack, removing flags.
Comment 23 Xisco Faulí 2017-07-13 10:18:50 UTC
Setting Assignee back to default. Please assign it back to yourself if you're
still working on this issue