• Resolved blue

    (@life2)


    Hi,

    I want to increase the letter by one or more in the calculations based on a formula. I’m basically looking for a formula similar to these ones used in Excel which translate to the letter A, B, and C respectively:

    =CHAR(65)

    =CHAR(66)

    =CHAR(67)

    Is there a formula like these?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author CodePeople2

    (@codepeople2)

    Hello @life2

    Yes, you can use the String.fromCharCode:

    String.fromCharCode(65)

    String.fromCharCode(66)

    String.fromCharCode(67)

    Best regards.

    Thread Starter blue

    (@life2)

    Okay, thank you. Another question, how do I convert a fraction to a simpler one (e.g. 5/4 to 1 1/4)?

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @life2

    You’re not simplifying the fraction but rather converting it from fraction notation to a mixed number. The current plugin version doesn’t offer a specific operation to perform this conversion; however, it’s a basic mathematical procedure. To achieve this, extract both operands—the numerator and the denominator—and then follow these steps:

    1. Compute the integer division using the FLOOR operation.
    2. Determine the division remainder using the REMAINDER operator.
    3. Concatenate the integer result with the remainder over the original denominator to display the mixed number.

    If you need we implement it to your project, contact us via the plugin website: Contact Us

    Best regards.

    Thread Starter blue

    (@life2)

    The operator ‘String.fromCharCode’ does not work when I use a variable inside the brackets. I need to do something like this ‘String.fromCharCode(25+fieldname1)’. How to make this work?

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @life2

    We included, In the latest plugin update, specific operations to make the process easier. Now, you can implement the equation as follows:

    CODETOCHAR(25+fieldname1)

    Note that the plus (+) operator is overloaded in JavaScript. It is used for adding numbers or concatenating texts. However, the concatenation takes precedence.

    To solve the ambiguity I recommend using the SUM operation instead of the plus operator:

    CODETOCHAR(SUM(25, fieldname1))

    If the issue persists, please provide the link to the page containing the form to check the fieldname1 value and the equation in action.

    Best regards.

    Thread Starter blue

    (@life2)

    I implemented what you suggested exactly, just like this:

    CODETOCHAR(SUM(64, fieldname1))

    But it ignores the ‘fieldname1’ and instead returns the character @ (character #64).

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @life2

    Please provide the link to the page that contains the form to check the fieldname1 value.

    Best regards.

    Thread Starter blue

    (@life2)

    I actually had a mistake in the fieldname1 equation but I fixed it and everything is working fine now, thanks.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Using letters in calculations’ is closed to new replies.