Properly formatted large numbers
michaell at unimelb.edu.au
Wed Feb 10 16:20:59 CST 2010
Thanks Terry and Alex.
Yes, I suspect that your suggestions would work, but both involve me working
out how to trap clicks in the datagrid. That seems like more effort than I
can put in at the moment: I've found datagrids to be a bit of a mystery so
far and teaching starts here next week :-(
This is a very nice example from today's list digest that shows why this
issue can be important:
>> Hi Jacque, I made the suggestion I did because at 100 Million records plus
> 100 million? Yes, well...I think I read the zeros wrong.
Should there not be a numberformat setting that formats the numbers for
human readability using the system setting of delimiter?
>> Dear Listers
>> I'm working on some statistical simulations and regularly get output numbers
>> with anything from 1 to 7 digits. They are hard to read when they don't have
>> the conventional commas separating the thousands and millions. I've written
>> a simple function that does the comma formatting for me but it mucks up
>> sorting. Of course. (I'm using a datagrid to display the results and live
>> sorting is really handy.)
Terry Judd responded:
> Can you have two columns - one formatted, one not - and somehow apply the
> sort to the unformatted column. I guess the unformatted column would have to
> be of invisible and you'd need to have some way of trapping the selection of
> the column header. You might need Trevor's help there.
Alext Tweedy suggested:
> I've not yet used a datagrid, so this is a guess ....
> can you supply a custom sort function ? Something like
> function testLessThan p1, p2
> replace comma with empty in p1
> replace comma with empty in p2
> return p1 < p2
> end testLessThan
> -- Alex.
More information about the use-livecode