Ad Widget

Collapse

Looking for a piece of Javascript code to preprocessing values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbuyukkarakas
    Member
    • Aug 2014
    • 49

    #1

    Looking for a piece of Javascript code to preprocessing values

    Dear all,

    I'm trying to get values with curl from my Windows servers. Everything is fine but curl returns a value like ' 0,014582 '

    Eventually zabbix doesnt recognize this value as numeric (float) or numeric (unsigned), only as string.
    As you can guess, It doesnt help to me to draw a graph so I need to replace the comma to dot with value preprocessing. It seems that a piece of javascript code will be fine to do that. But my knowledge about Javascript is not enough to do that.

    Can anybody help me to convert 0,014582 to 0.014582 with Javascript ?

    Thank you. Regards.

    Mehmet

    PS : Changing local settings of Windows is not an option.
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    ex.
    Code:
    var result = value.replace(',','.');
    return result;

    Comment

    • mbuyukkarakas
      Member
      • Aug 2014
      • 49

      #3
      Atsushi, you saved my life. I really appreciate your help. It worked perfectly. Thank you so much.

      Mehmet

      Comment

      Working...