Go Back
2 Votes

Modify decimal masking to optionally suppress trailing decimal places with zero values.


Closed

Modify decimal masking so that it is possible to suppress the trailing zeroes of decimal place values.

For example:
    123.80000,'ZZZ.XXZZZ' would display  123.80
    123,80010,'ZZZ.XXZZZ' would display 123.8001
    123,80010,'ZZZ.XXXXX'. would display 123.80010
    123.00000,'ZZZ.ZZZZZ'; would display 123

Note that unless [left] or [right] were specified, the resulting text would
be aligned on the decimal place in the mask.
    123.80
    123.8001
    123.80010
    123




 

4 Comments | Posted by Bill Ferris to Synergy DBL on 5/24/2021 8:02 PM
Geoff MacCue
Hi Bill, I have a function I wrote years ago that does just what you suggested. I can provide it to you until your feature is implemented in Synergy DE.
It also handles negatives and other mask values like $.
Geoff
 

5/28/2021 7:02 AM   0  
Bill Ferris
Geoff-

Thank you for the offer, but I have also written a function to handle this.   But it would just be better if it were embedded into the language -- including the Toolkit.

5/28/2021 11:22 AM   0  
Steve Ives
While I agree with you that it would be nice to have some additional capabilities here, the current behavior has been in place for so long that ANY change, no matter how small, would be guaranteed to break people's code, left, right and center, and likely in a way that doesn't produce errors, but produces bad data! It might be that you can use XCALL S_BLD to achieve alternate results, and in .NET of course there is the extremely powerful String.Format(), but the traditional Synergy format mask functionality is to all intents and purposes, set in stone.

6/22/2021 4:41 PM   0  
Paul McMahon

I'd love some options here, too. I agree with Steve that it wouldn't be good to just change the existing methods, but I'd love if there were a way to optionally define different formats.  I'd think that introducing a new masking character would create problems for those who mask numbers into the middle of strings (e.g. ALPHA = DECIMAL, "Please pay $$$$$$.XX"), but I'd think new bracketed justifications could handle it, like [DEC] or [LEFT-DEC].


6/25/2021 8:52 PM   0  
Please log in to comment on this idea.