SV: Programmatically change the number format?

2020-03-18 Thread wangel--- via 4D_Tech
Thanks Chip
I will try it out.
--

Message: 1
Date: Mon, 16 Mar 2020 17:17:04 -0400
From: Chip Scheide <4d_o...@pghrepository.org>
To: 4d_tech@lists.4d.com
Subject: Re: AW: Programmatically change the number format? 
Message-ID: <20200316171704131062.e0cec...@pghrepository.org>
Content-Type: text/plain; charset=iso-8859-1

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


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

SV: Programmatically change the number format?

2020-03-16 Thread wangel--- via 4D_Tech
Thank you, Olivier and Kirk. Got It working now, thanks to you two.
Very much appreciated.



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: AW: Programmatically change the number format?

2020-03-16 Thread Chip Scheide via 4D_Tech
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 <4d_tech-boun...@lists.4d.com> Im Auftrag von wangel--- 
> via 4D_Tech
> Gesendet: Sonntag, 15. März 2020 20:10
> An: 4d_tech@lists.4d.com
> Cc: wan...@online.no
> 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:4d_tech-unsubscr...@lists.4d.com
> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

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:4d_tech-unsubscr...@lists.4d.com
**

AW: Programmatically change the number format?

2020-03-16 Thread Olivier Flury via 4D_Tech
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 <4d_tech-boun...@lists.4d.com> Im Auftrag von wangel--- via 4D_Tech
Gesendet: Sonntag, 15. März 2020 20:10
An: 4d_tech@lists.4d.com
Cc: wan...@online.no
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:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Programmatically change the number format?

2020-03-15 Thread Kirk Brooks via 4D_Tech
You treat each of the column objects separately. So let's say your columns
are named "col_1", "col_2" and so on. (This is the object name.)
Use OBJECT SET FORMAT to manage the formatting from there.
https://doc.4d.com/4Dv17/4D/17.4/OBJECT-SET-FORMAT.301-4882942.en.html

On Sun, Mar 15, 2020 at 12:09 PM wangel--- via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> 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:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
==
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Programmatically change the number format?

2020-03-15 Thread wangel--- via 4D_Tech
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:4d_tech-unsubscr...@lists.4d.com
**