Uniface on GitHub
Product (releases and patches)
Reported Issues (old)
Fixes and Updates
Has anyone got a solution they are willing to share as to how to display numbers in a DSP to a nice format?
I believe you should be able to handle this via the DIS($NLS(CURRENCY)) or DIS($NLS(NUMERIC)) -
check the CHM file under "Display Formats for Numeric and Float Data"...
DSPs don't appear to pay any attention to either the DIS syntax or the format trigger. I can do everything I want in the client server side, but not in the web page.
Okay, further updates, since 80% of these numbers are display only, if I change the widget type from editbox to Statictext_Updateable, the system starts to pay attention to the DIS() formats.
However, using the $NLS(CURRENCY) puts an unknown character in where there should be a pound sign.
Since it is now using the format trigger, I can 'roll my own' formatting to put a pound sign in, and have.
I am still left with the 20% of the fields which are editboxes, which I cannot format. I can live with this for the current web-page, but I can see this getting nasty when I want to do something more complex.
Here is an example on how to format number on an input using jquery and regular expressions: https://jsfiddle.net/j0rxrun8/1/
Hope it helps.
Looking at that one, it appears to work on keyup, which means it's for formatting on input, I'm looking to format several fields in many occurrences on display (page load), as well as when they are changed as a result of calculations (possibly also page load? Not sure which events fire when.
I was hoping this was a problem that had previously been solved within the community and we could share some known code to display numbers 'correctly' in a web-page.
© 2020 Uniface Privacy & Cookies | Privacy Statement | Legal