Question T2839
Visible to All Users

Change the question format

created 5 years ago (modified 5 years ago)

[Ticket cloned from T2796: Passing the context to SurveyJS from an existing React code]

By the way, I am also looking for a way to change the number format. Let's say if the user has input 123456 in the control of type number, I might want to display it as 123,456 or 1,23,456. I tried changing this format using survey.getQuestionByValueName("QUESTION_NAME").displayValue = "123,456"; but it is not working as expected. How can I change the formatting for such controls?

Answers approved by surveyjs Support

created 5 years ago

Hello,
question.displayValue is read-only property. You can't write a value into it. What question type are you talking about, text or expression?

Thank you,
Andrew
SurveyJS Team

    Show previous comments (1)

      Then it is defined by browser.
      We have the example of an third-party input mask integration example. It introduces inputFormat property that you may use.

        Thanks Andrew. Doesn't SurveyJS-Library support formatting Out of the box? I understand SurveyJS-Widget needs to be used along with other 3rd party libs.

          Unfortunately, we do not have a special mask edit yet. It is in our TODO list though.

          Thank you,
          Andrew
          SurveyJS Team