Announcement

Collapse
No announcement yet.

formatPriceNumber(close()) for symbol 6E returns 1,3100 instead of 1.3100

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

  • formatPriceNumber(close()) for symbol 6E returns 1,3100 instead of 1.3100

    It seems the Build 11.5.2891, Dec 4, 2012, changed how formatPriceNumber(close()) returns it's value.
    At least for the 6E and the ES it returns it with a comma and not with a dot.

    Please advice if there is a new setting somewhere or if it's a bug.

    Wayne
    Last edited by waynecd; 12-07-2012, 02:09 PM.

  • #2
    For confirmation, test the code below on "ES #F" or "6E #F" or "CL F3=1".
    For example for "ES #F" it returns:

    PHP Code:
    1415.75    1415,75
    1415.75    
    1415,75
    1415.75    
    1415,75
    1415.75    
    1415,75
    1416    
    1416,00 

    So, formatPriceNumber(close(0)) replaces the period with a comma.

    PHP Code:
    debugClear();
    function 
    main(){
        
    debugPrintln(close(0)+"\t- "+formatPriceNumber(close(0)));



    Originally posted by waynecd View Post
    It seems the Build 11.5.2891, Dec 4, 2012, changed how formatPriceNumber(close()) returns it's value.
    At least for the 6E and the ES it returns it with a comma and not with a dot.

    Please advice if there is a new setting somewhere or if it's a bug.

    Wayne
    Last edited by waynecd; 12-09-2012, 10:11 PM.

    Comment


    • #3
      Wayne,

      As a workaround, since formatPriceNumber() returns a string, you can call replace(",", ".") on the return value.

      For example,

      formatPriceNumber(close(0)).replace(",", ".")

      That will replace only one occurrence (which it seems is all you need). For a global replace, here's some examples:

      Last edited by SteveH; 12-20-2012, 10:07 AM.

      Comment


      • #4
        Thanks Steve,

        Good workaround.

        I use formatPriceNumber() in many of my scripts so I've implemented a similar workaround only in a few, leaving the rest for when they fix the issue (hopefully soon).

        Wayne

        Comment

        Working...
        X