get and set variable with a decimals

I want to get a variable and after that I want to set it again in another device, but with a 2 decimals. not rounded…
I am using

local temp1 = tonumber((luup.variable_get (“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 333)))

luup.variable_set (“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature1”, temp1, 340)

How to make this?
10x

Something like this?

luup.variable_set ("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature1", string.format("%.2f", temp1), 340)

Working.
Thank you!