Announcement

Collapse
No announcement yet.

Write fractions in text

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Write fractions in text

    Hello All;
    I am writing some values on the chart and am using the drawText function to do this.
    The problem I have is that some symbols like U.S. Bonds or U.S. Notes write as decimals instead of fractions.
    Is there an efs function that can convert the number to fraction?
    Thanks in advance
    Raffaele

  • #2
    Re: Write fractions in text

    Raffaele
    The function you are looking for is formatPriceNumber() which will display your value in the same format as that of the symbol in the chart [including whether you compact or not the prices]
    For the description and syntax see the link to the related article in the EFS KnowledgeBase
    Note that you should run a null check on the value prior to using the formatPriceNumber() function eg
    var myVar = your_value;
    if(myVar==null) return;//this is the null check
    drawText(formatPriceNumber(myVar),...);

    This should resolve the problem you are having
    Alex


    Originally posted by raf9
    Hello All;
    I am writing some values on the chart and am using the drawText function to do this.
    The problem I have is that some symbols like U.S. Bonds or U.S. Notes write as decimals instead of fractions.
    Is there an efs function that can convert the number to fraction?
    Thanks in advance

    Comment


    • #3
      Hello Alexis;
      Thank you very much for your responce and solution which worked perfectly.
      Raffaele

      Comment


      • #4
        Raffaele
        You are most welcome
        Alex


        Originally posted by raf9
        Hello Alexis;
        Thank you very much for your responce and solution which worked perfectly.

        Comment

        Working...
        X