>>
APLDN Home

>>
Events

>>
Trainings

>>
APL Books

>>
APLDN Links

>>
Discussion Groups

>>
Downloads

>>
Articles

>>
Library

>>
Learning Tools

>>
APLDN User IO

>>
APL2000.com




Bug Reports

Author Thread: Grid formatting problem
davin.church
Grid formatting problem
Posted: Friday, August 13, 2004 1:26 AM (EST)

Maybe I'm just cross-eyed and not doing/seeing this right, but numeric grid cell formatting doesn't seem to be working properly for me.  I'm running Grid version 5.0.20 under Win98.  What I'm seeing is that xFormats with leading "0"s are not zero-filling, and I can't get 0 values to blank at all by using an empty format string or one with just spaces.  Constant text in single quotes in the format also seems to be getting ignored unless it's also displaying digits.

 

Please find attached a demo function and a screen capture of what I'm seeing.

 

Oh, and as a side note, if I apply xFormat as a row default (column=0) instead of using specific cells, no formatting seems to be taking place at all.  (Uncomment a line in the demo function to see this behavior.)

 

Please let me know if I'm going crazy or if you see a problem here, too.



Attached file: GridFormatBug.zip


Comments:

Author Thread:
davin.church
Grid formatting problem
Posted: Friday, September 17, 2004 2:17 AM (EST)
Has anyone managed to replicate or correct this problem yet?

     

Support
Grid formatting problem
Posted: Friday, September 17, 2004 1:21 PM (EST)
This matter is still in the developers hands.  When we have an answer, it will be posted here.

APL2000 Support

     

Support
Grid formatting problem
Posted: Friday, September 17, 2004 4:05 PM (EST)

Davin,

 

Here are the developer's answers to your questions:

> What I'm seeing is that xFormats with leading "0"s
> are not zero-filling

It was never intended [for xFormat] to force leading zeros.  Its function is just to ensure that at least ONE of them (zeros) is displayed to left of decimal point for numbers such as 0.12.  Without a leading 0 token in xFormat string, you will get .12 displayed.  With the leading 0 it gets displayed as 0.12.  The number of leading 0's or #'s does NOT matter.  Only the presence of absence of at least one leading 0 matters.  Maybe this should be changed to display a minimum number of places to left of decimal.  I think this can be done without too much trouble.  And maybe it would be a good idea.  But it still won't be zero filled to the width of the column being displayed.  It would just fill to the specified number of digits.  And it would not display a leading zero if the number has more than that number of digits.  In other words a specification of '0000' would display the number 12 as 0012 but would display the number 12345 as 12345.

If you want a leading zeros or other string you can specifying as literals such as this format specification: "'00000'0.00".  This will display the number 123.45 as 00000123.45.


> and I can't get 0 values to blank at all by using an empty format string
> or one with just spaces. 

He can do this using a format specification such as follows:

 "0.00;-0.00; "

Note the trailing blank space.  An empty format phrase copies the positive phrase.  So specifying "0.00;-0.00;" isn't the same as results in the formatting zeros like positive numbers.


> Constant text in single quotes in the format also seems to be  getting
> ignored unless it's also displaying digits.

His demo tries to display 'xxxx' in one of the rows.  But at least one of these must specify the 'xxxx' in conjunction with a numeric token such as 'xxxx'0 to specify this as being a numeric format specification.  Pure literal formats are ignored unless either the positive, negative, or zero format strings specify numeric formatting.  If he wants to display +/-/blank for positive, negative, zero, he would probably be better of using a text cell rather than trying to bend numeric formatting around a tree.

> Oh, and as a side note, if I apply xFormat as a row
> default (column=0) instead of using specific cells, no
> formatting seems to be taking place at all. 

There isn't any such thing as a "row default".  There are only column defaults.  Row defaults are something I've always wanted to add but never manage to get around to.  But they don't exist at the present and are just a "black hole" for any attributes you set in column 0, not just for xFormat.



APL2000 Support

     

davin.church
Grid formatting problem
Posted: Monday, September 20, 2004 2:20 AM (EST)

> What I'm seeing is that xFormats with leading "0"s
> are not zero-filling

 

It was never intended [for xFormat] to force leading zeros.  Its function is just to ensure that at least ONE of them (zeros) is displayed to left of decimal point for numbers such as 0.12.  Without a leading 0 token in xFormat string, you will get .12 displayed.  With the leading 0 it gets displayed as 0.12.  The number of leading 0's or #'s does NOT matter.  Only the presence of absence of at least one leading 0 matters.  Maybe this should be changed to display a minimum number of places to left of decimal.  I think this can be done without too much trouble.  And maybe it would be a good idea.  But it still won't be zero filled to the width of the column being displayed.  It would just fill to the specified number of digits.  And it would not display a leading zero if the number has more than that number of digits.  In other words a specification of '0000' would display the number 12 as 0012 but would display the number 12345 as 12345.

That was not clear to me.  I think that being able to force a specific number of digits by prepending leading zeros would be beneficial.  I don't recall seeing any system that provides digit formatting doing it any other way.

 

For instance, if I want to format product numbers with leading zeros to make them 6 digits long, I'd like to be able to do that.  (Ex: 154 --> 000154)

If you want a leading zeros or other string you can specifying as literals such as this format specification: "'00000'0.00".  This will display the number 123.45 as 00000123.45.

This doesn't help at all when you have a variable number of digits coming in but want a fixed number of digits displayed.

> Constant text in single quotes in the format also seems to be  getting
> ignored unless it's also displaying digits.

 

His demo tries to display 'xxxx' in one of the rows.  But at least one of these must specify the 'xxxx' in conjunction with a numeric token such as 'xxxx'0 to specify this as being a numeric format specification.  Pure literal formats are ignored unless either the positive, negative, or zero format strings specify numeric formatting.  If he wants to display +/-/blank for positive, negative, zero, he would probably be better of using a text cell rather than trying to bend numeric formatting around a tree.

I don't see why I should have to include a digit in my formatting, especially when I'm trying to show non-numeric (or zero-only) data in some special way.  Forcing a digit to display doesn't make much sense in such cases.  I'd like to be able to show "N/A" if no numeric value is present, for instance, but allow them to enter an number via normal numeric editing.  Regular numbers should then display in the usual way.

> Oh, and as a side note, if I apply xFormat as a row
> default (column=0) instead of using specific cells, no
> formatting seems to be taking place at all.

 

There isn't any such thing as a "row default".  There are only column defaults.  Row defaults are something I've always wanted to add but never manage to get around to.  But they don't exist at the present and are just a "black hole" for any attributes you set in column 0, not just for xFormat.

That's funny - I thought that those were available (at least for some attributes).  I guess I was thinking of something else.  I don't think this one was a major issue for me, just something I ran into while complaining about the other stuff. 

 

Might we get some of these things onto a request list sometime?

     

davin.church
Grid formatting problem
Posted: Monday, September 20, 2004 2:28 AM (EST)

He can do this using a format specification such as follows:

 "0.00;-0.00; "

Note the trailing blank space.  An empty format phrase copies the positive phrase.  So specifying "0.00;-0.00;" isn't the same as results in the formatting zeros like positive numbers.

Oh, and I forgot to mention...  I was trying it both with and without a trailing space, without any success.  I guess I forgot to demonstrate that, but you can add the spaces to my format string and see that it still doesn't work.

     



APL2000 Official Web Site

The true "final frontier" is in the minds and the will of people.
-- Gen. Michael E. Ryan, U.S. Air Force Chief of Staff

APLDN Home   |    |  Events   |  Trainings   |  APL Books   |  APLDN Links   |    |  Discussion Groups   |    |  Downloads   |  Articles   |  Library   |  Learning Tools   |  APLDN User IO   |  APL2000.com   |