Home > Archive > Getting Started with dBASE > November 2006 > decimals









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author decimals
dlit

2006-11-07, 7:13 pm

When passing a numeric variable to a form, it is displayed with 14 decimals even if set decimals has been set to 2 or 3. Why and how to display in a chosen format.
Dom
John Marshall

2006-11-07, 7:13 pm


Use a transform function (see OLH) to set the picture for the form control you are using.

JM


dlit Wrote:

> When passing a numeric variable to a form, it is displayed with 14 decimals even if set decimals has been set to 2 or 3. Why and how to display in a chosen format.
> Dom


dlit

2006-11-09, 7:14 pm

This transforms the numeric variable into a character one which is not what I wish.
Another problem I omitted to mention in my initial message is that not only the variable is displayed in the entryfield with 14 decimals but its value is modified by some additionnal digits in its display. (For instance, 1455.58 becomes 1455.57999999....
or 1455.5800000035.. or the like).
What I wish is displaying in an entryfield a variable at a precalculated value to be or not modified by the user according to his choice (not only displaying it)
Dom


John Marshall Wrote:

>
> Use a transform function (see OLH) to set the picture for the form control you are using.
>
> JM
>
>
> dlit Wrote:
>
>


John Marshall

2006-11-09, 7:14 pm


Can't you just place the transform results into a val()? What about round() It sounds like your numeric source is the result of division. Perhaps this number should be truncated before you pass it as a parameter.

JM

dlit Wrote:

> This transforms the numeric variable into a character one which is not what I wish.
> Another problem I omitted to mention in my initial message is that not only the variable is displayed in the entryfield with 14 decimals but its value is modified by some additionnal digits in its display. (For instance, 1455.58 becomes 1455.57999999...

. or 1455.5800000035.. or the like).
> What I wish is displaying in an entryfield a variable at a precalculated value to be or not modified by the user according to his choice (not only displaying it)
> Dom
>
>
> John Marshall Wrote:
>
>


dlit

2006-11-10, 7:15 pm

I had tried the round but doesn t change anything. Yes of course I can transform tranform() result in a numeric variable again but not only the modification of display of a formatted variable (through decimals setting or even round()) is strange but still
more the modification of its value itself as per my previous message. Sounds buggy.
Dom


John Marshall Wrote:

>
> Can't you just place the transform results into a val()? What about round() It sounds like your numeric source is the result of division. Perhaps this number should be truncated before you pass it as a parameter.
>
> JM
>
> dlit Wrote:
>
... or 1455.5800000035.. or the like).[color=darkred]
>


John Marshall

2006-11-10, 7:15 pm


If it is just an entryfield display issue, why can't you use the picture to control the display length? Try @R "9999.99"

JM

dlit Wrote:

> I had tried the round but doesn t change anything. Yes of course I can transform tranform() result in a numeric variable again but not only the modification of display of a formatted variable (through decimals setting or even round()) is strange but sti

ll more the modification of its value itself as per my previous message. Sounds buggy.
> Dom
>
>
> John Marshall Wrote:
>
9.... or 1455.5800000035.. or the like).[color=darkred]
>


dlit

2006-11-13, 7:13 pm

Yes I know that but
1/entryfield means gate to enter a value that can be predefined or not and therefore displayed with a nul or predefined value.

2/ the point I m stressing is that a numeric value should be displayed as such and as per the predefined format meaning with no or a predefined number of decimals set by a former "set decimals to" command.

3/ in the meantime I found a way to predefine a numeric value by setting the property of the entryfield as follows :
onOpen = {;this.value=variable}
Beforehand I put this setting by " onOpen=class:ENTRYFI
ELD1_ONOPEN" linking to a function saying "This.value=variable".

Strangely these two syntax don t put the same result out and woudl be interested if you or someone has an explanation.
Dom


John Marshall Wrote:

>
> If it is just an entryfield display issue, why can't you use the picture to control the display length? Try @R "9999.99"
>
> JM
>
> dlit Wrote:
>
till more the modification of its value itself as per my previous message. Sounds buggy.[color=darkred]
999.... or 1455.5800000035.. or the like).[color=darkred]
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com