Re: [gnome-db] Formatting numbers in Form/Grid



On Thu, 2007-02-01 at 14:12 +0100, Vivien Malerba wrote:
> On 2/1/07, Murray Cumming <murrayc murrayc com> wrote:
> > On Wed, 2007-01-31 at 22:55 +0100, Vivien Malerba wrote:
> > > > > As a matter of fact I was planning to add a way to specify a mask to
> > > > > enter data (as for example like
> > > > > http://gtkmaskedentry.sourceforge.net/), and other attributes such as
> > > > > text max length; so if you can wait till next week (I probably won't
> > > > > have the time to do it before), you'll have the framework in place to
> > > > > add more format spec.
> > > >
> > > > Great. Are you sure that that will deal with the same problem as
> > > > numerical representation, or just what formats may be entered?
> > >
> > > It's up to you to define what the attributes will be and what they
> > > will do. The only constraint is that the GnomeDbDataEntry or
> > > GtkCellRenderer used take a GValue as input and returns a GValue when
> > > the data being displayed is modified.
> >
> > I'm not convinced that a text-entry mask can define how numbers should
> > be represented, but I look forward to seeing this. Thanks for the work.
> 
> I did not pretend it was. I just gave the example of the text-entry
> mask as a feature I'm about to add. For your specific need, maybe
> another "option" will be necessary, but, if that is the case, adding
> it will be a matter of writing the code as all the "glue code" to
> declare the option will be there (with the test-entry mask option).
> 
> BTW, what is exactly your requirement regarding number presentation
> (maybe I can code it all at once)?

It's hard to know exactly what people will need in general. To be
open-ended I guess we need a printf-style format string.


For me, Glom need these few options:
http://www.glom.org/wiki/index.php?title=Screenshots#Designing_the_Layout_-_Formatting

(Note that we must do the correct thing for the locale. So a thousands
separator would be a . in Germany, but a , in the UK, for instance.
Likewise for the decimal place separator. Then the application coder
does not need to worry about the locale.)

That's described by this C++ object, which is fairly obvious:
http://svn.gnome.org/viewcvs/glom/trunk/glom/libglom/data_structure/numeric_format.h?view=markup

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]