Menu

Format of a value inside "New text"

Help
chris_14
2008-06-12
2012-12-14
  • chris_14

    chris_14 - 2008-06-12

    Hi all,
    I want to use the "New text" function to make the value of a power counter visible. What do I have to fill in the field "Pattern"? What are the allowed values of the fields "Style" and "Format"?

    Best regards,
    Chris

     
    • jef2000

      jef2000 - 2008-06-12

      Hi,

      Style field can contain everything that is allowed in the style attribute of a <td> html tag.
      All the possible values are described in the CSS documentation.

      Format field contains the text to display. If the "Insert value" checkbox is checked, you can  put a "$1" (without quotes) where the object value has to be inserted.
      If pattern field is empty, the object value is inserted as it is. If you need more advanced formatting, you can use the pattern field to specify a pattern to match. Each of the parenthesis groups in the pattern will correspond to $1, $2, $3, ... in the format field.

      For example, the date in format YYYY-MM-DD can be transformed in DD/MM/YYYY using pattern "(\d+)-(\d+)-(\d+)" and format "Date: $3/$2/$1". For the complete list of possibilities offered by patterns, see:
      http://www.w3schools.com/jsref/jsref_obj_regexp.asp

      Regards,

      Jean-François

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.