Skip to content

tonumber() can't convert floats #845

@ronja-ui

Description

@ronja-ui

Describe the bug

If the value is a floating-point number, tonumber() returns nothing.

Expected behavior

tonumber() should be able to convert 2.5 string value to a number.

How to reproduce

| makeresults
| eval number="2.5"
| eval convert=tonumber(number)

If you try the following, it will return error instead of 2.5:

class java.lang.Double cannot be cast to class java.lang.String (java.lang.Double and java.lang.String are in module java.base of loader 'bootstrap')

| makeresults
| eval convert=tonumber(2.5)

Screenshots

Software version

pth_10 version: 12.1.1

Desktop (please complete the following information if relevant):

  • OS:
  • Browser:
  • Version:

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions