DECIMALPLACESMAX How To?

BeliasBelias Member Posts: 2,998
How use this function on a field?
I want to set decimal places on the fly but i can't manage to use this function...
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Answers

  • BeliasBelias Member Posts: 2,998
    oh...this is the help:
    DECIMALPLACESMAX (Control)
    Use this function to return the current setting of the maximum number of decimal places for a control (field or text box), and to set a new value. The function manipulates the maximum number-part of the setting of the DecimalPlaces property.

    [CurrMaxDecimals] := DECIMALPLACESMAX([NewMaxDecimals])
    CurrMaxDecimals

    Data type: integer

    The current setting of the maximum number of decimal places.

    NewMaxDecimals

    Data type: integer

    The new setting of the maximum number of decimal places.

    Comments
    See the description of the DecimalPlaces property for details.

    I can imagine i can use the function with "currform.control.decimalplaces"...but in the help they wrote FIELD, too.
    maybe they intend only "control" fields and not the phisical field on the table?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • garakgarak Member Posts: 3,263
    you can only ste the Min / Max down, not up.

    For example: Default is 0:9 you can only set CurrForm."PurchasePrice".DECIMALPLACESMAX(8). If you set CurrForm."PurchasePrice".DECIMALPLACESMAX(10) the system will scream ....
    Do you make it right, it works too!
  • BeliasBelias Member Posts: 2,998
    garak wrote:
    you can only ste the Min / Max down, not up.

    For example: Default is 0:9 you can only set CurrForm."PurchasePrice".DECIMALPLACESMAX(8). If you set CurrForm."PurchasePrice".DECIMALPLACESMAX(10) the system will scream ....

    logical...but what i really meant was: can't i use the function under the table?i think not...(effectively it should be a really painful thing to decrease the decplaces of a field...)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Yes, it's only for controls.

    I never notice that it can only be decreased. That's very annoying if you have only a few records where you want the user to be able or force the user to enter more decimal places. :(
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • BeliasBelias Member Posts: 2,998
    well, I solved my problem in another way as this function can't be used...I misunderstood the help...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.