it is simplest to define the format in the structure under formats and filters 
giving the format a name like "MyNumericFormat"

then in code you can simply refer to the format as "|MyNumericalFormat"
NOTE: the pipe (vertical bar) in front of the name.

this way you can use the same format throughout the system, and if your needs 
change you can change it in one place and not have to search all over the 
system for, and change every occurrence of the format, where you to simply type 
the format inline (in your code directly).


Chip
> Hi,
> 
> I suppose you want to display noting (or a special value, e.g. "-") 
> if the value is zero?
> 
> Defining a number format has the following pattern: "positive 
> values{;negative values};{zero}".
> 
> Example: "### ### ### ###.00;-### ### ### ###.00;-"
> 
> In other words: you just need to define one display format, no need 
> to apply an other display format for zero values.
> 
> HTH,
> 
> Olivier
> 
> |||||| https://flury-software.ch/
> 
> -----Ursprüngliche Nachricht-----
> Von: 4D_Tech <[email protected]> Im Auftrag von wangel--- 
> via 4D_Tech
> Gesendet: Sonntag, 15. März 2020 20:10
> An: [email protected]
> Cc: [email protected]
> Betreff: Programmatically change the number format? 
> 
> In a listbox with a selection of records I have some columns with numbers.
> They have the number format 0.00. Not all the cells have numbers 
> greater than 0, so is it possible to programmatically change the 
> format to #.## in cell where the number is 0?
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
------------
Hell is other people 
     Jean-Paul Sartre
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to