How to use python floating number in playbook.

Solution Verified - Updated -

Issue

  • How to use python floating number in playbook.

  • We are running python (float) command in playbook but getting strange results. The results is the floating number show with a lot of decimal number

    ok: [MYPRVLXRNRM06] => {
        "tagname": "1.4000000000000004"
    

    How to make only 1 decimal number in this floating (ex: 1.4 only)?"

Environment

  • Red Hat Ansible Automation Platform 2.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content