Datagrid Decimal Alignment

Glen Bojsza gbojsza at gmail.com
Sat Jul 24 18:29:09 EDT 2010


Yes, this did the trick!

Also, this shows how much there is to learn with DataGrid.

thanks.

On Sat, Jul 24, 2010 at 1:36 PM, zryip theSlug <zryip.theslug at gmail.com>wrote:

> On Sat, Jul 24, 2010 at 4:49 PM, Glen Bojsza <gbojsza at gmail.com> wrote:
> > Hello,
> >
> > I have tried implementing Decimal Alignment from the sample given with
> > Datagrid.
> >
> > Problem is that the negative sign doesn't show?
> >
> > If you double click and add a negative sign in from of the number it
> doesn't
> > show.
> >
> > Also if you double click and enter a new number with a negative sign then
> it
> > changes the value to 0.0?
> >
> > Any advice?
>
> Hi Glen,
>
> Assuming that this sample is linked to the 'How Do I Align Decimals in
> a Column?' lesson
>
> http://lessons.runrev.com/spaces/lessons/manuals/datagrid/lessons/7331-How-Do-I-Align-Decimals-in-a-Column-
>
> The problem should reside in the FillinData handler:
>
> set the itemDel to "."
> set the text of fld "leftvalue" of me to max(0,item 1 of pData) & "."
> set the text of fld "rightvalue" of me to max(0,item 2 of pData)
>
> Negative numbers are ignored due to the use of the max function.
>
> Replace the content of the handler by:
>
> set the itemDel to "."
> set the text of fld "leftvalue" of me to item 1 of pData & "."
> set the text of fld "rightvalue" of me to max(0,item 2 of pData)
>
> You have now to take care that the user has not started the number by a
> dot.
>
>
> Regards,
> --
> -Zryip TheSlug- wish you the best! 8)
> http://www.aslugontheroad.co.cc
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the Use-livecode mailing list