"Integer" means "whole number". 1
is an integer, 1.4
is not.
Second, you're not using a string at all.
var new_str = 1.4
creates a float variable with a value of 1.4
.
var new_str = "1.4"
would create a string.
If all you want is 1.4
then you already have that.
If you do have a string such as "1.4"
and you want to convert to a float, then you should use float()
instead of int()
.