Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6938925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:33:15+00:00 2026-05-27T12:33:15+00:00

In a form I have 2 fields one is as Decimal # and another

  • 0

In a form I have 2 fields one is as Decimal # and another as Amount(Real).

Decimal # is an Enum having values from 1-5 and default value will be 5.

Requirement:

1) Whenever value is selected for Decimal # field (1-5), depending upon the value selected

No of decimal should be allowed in Amount field.

Ex1: If Decimal # = 2

      Amount    = 1.24

Ex2: If Decimal # = 3

      Amount    = 1.521

Ex1: If Decimal # = 4

      Amount    = 3.0124

Ex1: If Decimal # = 5

      Amount    = 8.02145

Solution: I wrote modified method on Decimal # control level, so depending on value selected for Decimal # it will allow that many decimals for Amount field. This much is working fine, now.

But as shown in above examples the Amount field of all the records in the grid changes according to Decimal # in latest row entered.

Means, First row: if Decimal # = 2 then Amount = 1.02

Second row: If Decimal # = 3 then Amount = 4.623

But that time first row also takes limit as 3 though the Decimal # = 2.

Please guide me in this regard.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:33:16+00:00Added an answer on May 27, 2026 at 12:33 pm

    Sorry, but there is no reliable way to have different number of decimals in a grid control.

    The change for the current record may affect other records displayed in the grid.

    For a group control the number of decimals is easily adjusted like this:

     amountCtrl.noOfDecimals(trans.decimalNo);
    

    In the grid, you could try using a edit method with a string value. You will have to do the conversion yourself.

    edit DecimalStr amountStr(boolean set = false, DecimalStr _amountStr = '')
    {
        if (set)
        {
            this.Amount = str2num(_amountStr);
        }
        return num2str(this.Amount, 0, this.decimalNo, 1, 0)
    }
    

    The DecimalStrextended data type should be right aligned.

    Unfortunately str2num accepts only period as the decimal point and does not accept thousand seperators, so it is not a “user friendly” function for numeric conversion. You may have to make you own to take account of regional settings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a requirement to copy all fields from one form to another similar
I have one form with several text fields and one button. When i enter
I have a form and one of the fields is a check-all-that-applies type field
I have a form with 3 fields (simplyfied example). The first one is a
I have an InfoPath form with several fields on, the problem is that one
I have a usual login form consisting of two input fields, one for login,
I have 4 fields and one map on my form. I have to choose
I have Access Form with some Text fields and one Button. Is there any
I have two fields in my form : one is the limit and other
I need to programatically send a form over POST. I have 4 fields, one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.