Trying to Convert this JS to C#

I have been trying to convert a script in a book to c# since that is the langauge I am most comfortable with and can’t seem to figure how to make it work

these are the variables I need at the top it says

var rotationSpeed : float = 20.0; 
private var rotationSensitivity = 0.1 ;

and this is the FixedUpdate in JS

function FixedUpdate ()
{ 
if(Input.GetAxis("Turn"))
{
var rotation : float = ( Input.GetAxis("Turn") ) * rotationSpeed * rotationSensitivity; 
rotation = rotation + transform.eulerAngles.y ; 
transform.localRotation = Quaternion.AngleAxis ( rotation, Vector3.up ) ; 
}

in C# I get the problem with it saying “can not convert type float to bool” which makes sense I guess

Mostly need to be pointed in the right direction to fix it
Or if you are feeling the season make my life easier and show me lol

P.S. I tried to format this so the code looked right and could not figure out how

This error seems to come from:

if(Input.GetAxis("Turn"))

GetAxis returns a float, and the if requires a boolean expression. You could replace this with:

if (Input.GetAxis("Turn") != 0.0f)

This is the C# version of the code you posted:

    public float rotationSpeed = 20.0f;
    float rotationSensitivity = 0.1f;

    void FixedUpdate()
    {
        if (Input.GetAxis("Turn") != 0.0f)
        {
            float rotation = Input.GetAxis("Turn") * rotationSpeed * rotationSensitivity;
            rotation = rotation + transform.eulerAngles.y;
            transform.localRotation = Quaternion.AngleAxis(rotation, Vector3.up);
        }
    }

It is a bit prettier like this:

    public float rotationSpeed = 20.0f;
    private float rotationSensitivity = 0.1f;

    void FixedUpdate()
    {
        float turnAxis = Input.GetAxis("Turn");
        if (turnAxis != 0.0f)
        {
            float rotation = turnAxis * rotationSpeed * rotationSensitivity + transform.eulerAngles.y;            
            transform.localRotation = Quaternion.AngleAxis(rotation, Vector3.up);
        }
    }

Please don’t forget to accept the answer which solved your problem.