• Resolved lowercas3

    (@lowercas3)


    Hello, what is the function to convert a binary entry (assume a field entry consisting of a string of 0’s and 1’s) to it’s decimal equivalent?

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @lowercas3

    Thank you very much for using our plugin. Assuming the field’s name is fieldname1, the equation in the calculated field would be:

    parseInt(fieldname1|r, 2);

    The |r modifier allows you to access the field’s raw values instead of the preprocessing one. The plugin preprocesses the fields’ values to use them in mathematical operations.

    Best regards.

    Thread Starter lowercas3

    (@lowercas3)

    Thank you for your response. This works except when there’s a zero as the first digit. 101 works for instance but 0101 does not.

    Any thoughts on how to resolve this?

    Best wishes

    Plugin Author codepeople

    (@codepeople)

    Hello @lowercas3

    Could you please indicate the control type that contains the number in binary format?

    You must use a “Single Line” text field and refer to it from the equation with the |r modifier.

    Could you please provide the link to the page that contains the form to check your equation in action?

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Binary to Decimal value’ is closed to new replies.