Formatting variable with dynamic numeric values

hpw
hpw Community Member Posts: 3
Hi everybody,



we would like to format numbers, e.g. 1,034,645 instead of 1034645 or 34,765 instead of 34765, when showing up in a text field.



The values are dynamic (according to settings user can make using some buttons). When hitting 'Show result' the variable value is assigned to a text field - and should be presented in a formatted way as stated above.



Any clue how to do this?



Thanks for your advice...

Comments

  • jm
    jm Community Member Posts: 21
    Sounds like I have a similar problem. I use the "Change Content" feature to replace text in a text box depending on the option selected by the learner. I want the text that appears in that text box to be formatted differently than the rest of my title but can't figure out how to do this.



    I've tried leaving some spaces in the text box and formatting them as I want. That works the first time text is displayed in the box but only the first time. Any other text appears in the "normal' font I use for my title.



    Do I also have to use Java to change the script of the text box I use to display my variable? This is a problem as I'm not familiar with Java.



    Thanks,



    J-M
  • benpitman
    benpitman Community Member Posts: 763
    Depends on how much formatting you are talking about. If you just want the text box to have a different font, font size, or color, just put a few characters in the text box and a few blanks. Select all and format. Then delete all but the blank spaces. But if you want to format it with some words different from others, then you have to either use JavaScript or Jquery (which I do not know)
  • jm
    jm Community Member Posts: 21
    Hi Ben,



    Thanks for the suggestion, but that's what I've been trying to do and it doesn't work. Just tried it again following your advice.



    I have a graphic with 5 hot spots where learners can place their mouse and see additional information. After doing as you suggest, the first time I run the page and place my mouse over a hot spot, the text box is updated (Change Content) and text displays as I previously formatted it using a few characters and space. From them on, text is displayed in the regular font I use for the rest of the unit instead of the special formatting I want to use.



    Cheers, J-M
  • timk
    timk Community Member Posts: 1,205 ♦ Idol ♦
    You can add a CSS class to your textfield that contains all formatting styles you want. The formatting should then survive several Change Content actions.



    Tim
  • benpitman
    benpitman Community Member Posts: 763
    Ok, then your other workaround is to change the default font for the page using the page properties. Then change the normal text blocks to what you want. Beyond that, javacript/html/css