Re: Maybe there is an error on this?

Mike Aubury <[email protected]>
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <CAGAq4WFL0-04jYF5bCPY27PPDP0u3e99eCsE4c5auk23BuwwEQ@mail.gmail.com>
It would seem the simplest solution is to use decimal(32,16) - or whatever
you need for the precision, and to use a FORMAT for the display ?

As I said - I've worked on many many commercial applications - and I've
never used a decimal(x) in any of them..


It might be easier to fix the 4gl compilers to detect decimal(x) and
replace it internally with a decimal (32,16) [ instead of the current
(x,2)] and generate a format for the form fields or something ?


Failing that - I think it would need some considerable development to add
in the proper functionality ...







On 5 December 2013 12:57, Alain Siverly <[email protected]> wrote:

>  ok, then you are a lucky guy if you do not need it :-)
>
> we have 470 columns on the database defined as "decimal(16)" and to change
> so much columns on customer systems takes too much time so we have a kind
> of major problem.
>
> we also have 735 variables defined as decimal(16) in the 4gl code and if
> we have to change it, then we must use one variable for display values on
> screen forms and another for calculation puposes, instead of only one
> variable for both.
>
> the reason of using decimal(16) is to show 2 decimal numbers on screen
> forms (which is common on commercial applications) but calculate internally
> with more precision.
>
> which kind of definition do you recommend in order to get the most
> precision, as an alternative to decimal(16)?
>
> cheers
> alain
>
>
> Am 05.12.13 13:04, schrieb Mike Aubury:
>
>   Yes - internally - a DECIMAL(x) defaults to DECIMAL(x,2) for Aubit4gl
>
> This is a known limitation
>
>
>        |       KW_DECIMAL OPEN_BRACKET INT_VALUE CLOSE_BRACKET {
>
> $$=new_simple_variable(NULL,DTYPE_DECIMAL,atoi($<str>3)*256+2,0);
>                         add_feature("DEFINE_DECIMAL");
>
>                 }
>
>  It would be quite difficult to fix this one - as it would be quite far
> reaching.
>
> Personally - I have never used a DECIMAL(x) - only ever a DECIMAL(x,y)
>
>
>
>
> On 5 December 2013 11:58, Alain Siverly <[email protected]> wrote:
>
>>  Hello,
>>
>> in the attachement we show an example where a DECIMAL(16) variable rounds
>> reduces the decimal numbers to 2 digits internally. 4js uses internally all
>> digits but shows only 2. Also Informix seems to act the same way as we
>> found in the I-4GL manual:
>>
>> "For DECIMAL(p,0) data types, any significant digits
>> (within the declared precision) in the fractional part of a data value
>> are stored
>> internally, but are not displayed. For example, if a data value of 0.25
>> is stored
>> in the DECIMAL(25,0) variable Q, the value of Q is displayed as zero, but
>> the
>> Boolean expression (Q > 0) evaluates as TRUE."
>>
>> If this is an error, could it be possible to get a correction on A4GL?
>>
>> Thanks in advance!
>>
>> Cheers
>> Alain
>> VENTAS AG
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Sponsored by Intel(R) XDK
>> Develop, test and display web and hybrid apps with a single code base.
>> Download it for free now!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Aubit4gl-discuss mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>>
>>
>
>
>
> ------------------------------------------------------------------------------
> Sponsored by Intel(R) XDK
> Develop, test and display web and hybrid apps with a single code base.
> Download it for free now!
>
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
> _______________________________________________
> Aubit4gl-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>
>

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.