Re: FORMAT NUMBER

2019-08-06 Thread Koen Van Hooreweghe via 4D_Tech
Hi Ferdinando,

Just tested v16.5 (on Mac, but that should not differ from Windows). IMHO there 
are no changes in number formatting between v16 and v17.
Created a 1 column array based list box on a form. Populated the array with 
some random real numbers.
The column is set to variable type 'Numeric' and number format being:  
###,##0.###;-###,##0.###;

This means, positive non zero numbers format up to 6 digits to the left of the 
decimal point and 3 to the right. Negative non zero numbers have minus sign 
followed by the same format as positive numbers and zero is displayed as blank.
In belgium we use period as thousands separator and comma as decimal point. 
Beware, 4D internally uses (US notation) period for decimal and comma for 
thousands. But at runtime uses the OS number format setting.
There is a compatibility setting for upgraded databases (created before v11)*

Eg: 1234567/1000 will display as 1.234,567 on my OS, but I have to set 
###,##0.### as number format in the property pane.

If you want to see three decimal digits for each number, you must use 
###,##0.000 as number format. This will display 1 as 1,000 or 12/10 as 1,200
If you have larger numbers, add extra # on the left side, eg ###,###,##0.000

HTH
Koen

*4D Design Reference>Database Settings>Compatibility page: "Use period and 
comma as placeholders in numeric formats": starting with v11, 4D uses regional 
system parameters for numeric display formats (see “Number formats” in Display 
formats). 4D automatically replaces the “,” and “.” characters in numeric 
display formats by, respectively, the thousand separator and the decimal 
separator defined in the operating system. The period and comma are thus 
considered as placeholder characters, following the example of 0 or #. In 
previous versions of 4D, numeric display formats do not take the regional 
parameters of the system into account. For example, the “###,##0.00” format is 
a valid format for an American system. However, when it is applied to a numeric 
value displayed on a French or Swiss system, the result is incorrect. 
In converted database, for the sake of compatibility, this new mechanism is not 
activated. To take advantage of it, you must check this option.

> Op 5 aug. 2019, om 23:24 heeft stardata.info via 4D_Tech 
> <4d_tech@lists.4d.com> het volgende geschreven:
> 
> I need to display a number in an array real displayed in a list box.
> In column settings of the list box, if I do not insert anything in Display 
> number format, the decimal numbers are correctly displayed, but I have 0 
> instead of blank.




Compass bvba
Koen Van Hooreweghe
Kloosterstraat 65
9910 Aalter
Belgium
tel +32 495 511.653

**
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: FORMAT NUMBER

2019-08-06 Thread Peter Bozek via 4D_Tech
Dňa ut, 6. aug 2019, 0:31 Chuck Miller via 4D_Tech <4d_tech@lists.4d.com>
napísal(a):

> Read my previous note. You will need to convert the array to text array
> and fill as a formatted number using code I already supplied
>

Format "### ###. 00;### ###. 00;" (format for positive, negative, zero)
should display empty string for 0.

--
Peter Bozek

>
**
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: FORMAT NUMBER

2019-08-05 Thread Chuck Miller via 4D_Tech
Read my previous note. You will need to convert the array to text array and 
fill as a formatted number using code I already supplied

Regards 
Chuck 

Sent from my iPhone

> On Aug 5, 2019, at 5:59 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> if ###,## does not display a blank for 0 you may have to  convert back 
> and forth to/from text to get the formatting you want
> 
> Chip
> 
>> On Mon, 5 Aug 2019 23:24:26 +0200, stardata.info via 4D_Tech wrote:
>> Sorry i use 4D V16 on Windows.
>> 
>> I need to display a number in an array real displayed in a list box.
>> In column settings of the list box, if I do not insert anything in 
>> Display number format, the decimal numbers are correctly displayed, 
>> but I have 0 instead of blank.
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 
> **
> 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: FORMAT NUMBER

2019-08-05 Thread Chip Scheide via 4D_Tech
if ###,## does not display a blank for 0 you may have to  convert back 
and forth to/from text to get the formatting you want

Chip

On Mon, 5 Aug 2019 23:24:26 +0200, stardata.info via 4D_Tech wrote:
> Sorry i use 4D V16 on Windows.
> 
> I need to display a number in an array real displayed in a list box.
> In column settings of the list box, if I do not insert anything in 
> Display number format, the decimal numbers are correctly displayed, 
> but I have 0 instead of blank.
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
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: FORMAT NUMBER

2019-08-05 Thread stardata.info via 4D_Tech

Sorry i use 4D V16 on Windows.

I need to display a number in an array real displayed in a list box.
In column settings of the list box, if I do not insert anything in 
Display number format, the decimal numbers are correctly displayed, but 
I have 0 instead of blank.


Thanks

Ferdinando

Il 05/08/19 21:00, 4d_tech-requ...@lists.4d.com ha scritto:

Message: 3
Date: Mon, 5 Aug 2019 11:48:46 -0400
From: Chuck Miller
To: 4DTechList Tech<4d_tech@lists.4d.com>
Subject: Re: FORMAT NUMBER
Message-ID:
<95863d81-6b67-400e-98a0-96534e372...@informed-solutions.com>
Content-Type: text/plain;   charset=utf-8

First of all. what version of 4D

I would think you can not do all you want with a number. You could do it with a 
text variable
for example

in the in display detail form event

If $YourNumber_R (is a real)
$YourNumber_R:= 100.5
$YourText:=string($YourNumber_R;”###.0”)

$YourNumber_R:= 100.52
$YourText:=string($YourNumber_R;”###.00”)


$YourNumber_R:= 0
$YourText:=“”

hope this helps

If do not think you cab change the format of a field during the display of it 
on a list box

Regards
Chuck
---
  Chuck Miller Voice: (617) 739-0306
  Informed Solutions, Inc. Fax: (617) 232-1064
  mailto:cjmillerinformed-solutions.com
  Brookline, MA 02446 USA Registered 4D Developer
Providers of 4D and Sybase connectivity
   http://www.informed-solutions.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: FORMAT NUMBER

2019-08-05 Thread Chuck Miller via 4D_Tech
That is why I asked about version and what you show is truncated not rounded

Also I would suppose ###.## would take care of all

Didn’t think of that one


Regards


Chuck

 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064   
 mailto:cjmillerinformed-solutions.com 
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D and Sybase connectivity
  http://www.informed-solutions.com  

This message and any attached documents contain information which may be 
confidential, subject to privilege or exempt from disclosure under applicable 
law.  These materials are intended only for the use of the intended recipient. 
If you are not the intended recipient of this transmission, you are hereby 
notified that any distribution, disclosure, printing, copying, storage, 
modification or the taking of any action in reliance upon this transmission is 
strictly prohibited.  Delivery of this message to any person other than the 
intended recipient shall not compromise or waive such confidentiality, 
privilege or exemption from disclosure as to this communication. 

> On Aug 5, 2019, at 12:14 PM, Keith Culotta via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> 10.1237 as 10.123 <- rounding

**
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: FORMAT NUMBER

2019-08-05 Thread Keith Culotta via 4D_Tech
This ##0.###; ;  produces good results for the example of 0.5
There are some things to watch for in the display detail event
4D v17

0 as blank
1 as 1
.5 as 0.5
.007 as 0.007
.0007 as 0  <- not blank
10.12345 as 10.123
10.1237 as 10.123 <- rounding

Keith - CDI

> On Aug 5, 2019, at 9:58 AM, stardata.info via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi All,
> 
> I need to format one column in a list box.
> The column contains numeric values.
> The values can have tre decimal digits.
> I want a blank if number is zero.
> I need to display 0,5 value for examples and i use ##0,00;; as a format but 
> not work.
> 
> Does someone have a suggestion?
> 
> Thanks
> 
> Ferdinando

**
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: FORMAT NUMBER

2019-08-05 Thread Chuck Miller via 4D_Tech
First of all. what version of 4D

I would think you can not do all you want with a number. You could do it with a 
text variable
for example

in the in display detail form event

If $YourNumber_R (is a real)
$YourNumber_R:= 100.5
$YourText:=string($YourNumber_R;”###.0”)

$YourNumber_R:= 100.52
$YourText:=string($YourNumber_R;”###.00”)


$YourNumber_R:= 0
$YourText:=“”

hope this helps

If do not think you cab change the format of a field during the display of it 
on a list box

Regards
Chuck
---
 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064   
 mailto:cjmillerinformed-solutions.com 
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D and Sybase connectivity
  http://www.informed-solutions.com  

This message and any attached documents contain information which may be 
confidential, subject to privilege or exempt from disclosure under applicable 
law.  These materials are intended only for the use of the intended recipient. 
If you are not the intended recipient of this transmission, you are hereby 
notified that any distribution, disclosure, printing, copying, storage, 
modification or the taking of any actionin reliance upon this transmission is 
strictly prohibited.  Delivery of this message to any person other than the 
intended recipient shall not compromise or waive such confidentiality, 
privilege or exemption from disclosure as to this communication. 

> On Aug 5, 2019, at 10:58 AM, stardata.info via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi All,
> 
> I need to format one column in a list box.
> The column contains numeric values.
> The values can have tre decimal digits.
> I want a blank if number is zero.
> I need to display 0,5 value for examples and i use ##0,00;; as a format but 
> not work.
> 
> Does someone have a suggestion?
> 
> Thanks
> 
> Ferdinando

**
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
**