# ¿Cómo aplicar una fórmula para ajustar el valor del sensor?

Dentro de la configuración de sensores encontrarás una columna para **Aplicar fórmula** al valor reportado por el sensor. Utiliza esta columna para cuando necesites cambiar el valor que envía el dispositivo a una unidad diferente.

[![image-1714146459878.png](https://docs.redgps.com/uploads/images/gallery/2024-04/scaled-1680-/image-1714146459878.png)](https://docs.redgps.com/uploads/images/gallery/2024-04/image-1714146459878.png)

Puedes utilizar cualquier fórmula, pero a continuación te mostramos ejemplos de fórmulas y funciones.

**IMPORTANTE:** Debes utilizar **X** para el dato crudo que recibimos del equipo y se desea modificar con la fórmula.

<table id="bkmrk-descripci%C3%B3n-f%C3%B3rmula%2F"><tbody><tr><td style="width: 561px;">**Descripción**

</td><td style="width: 248px;">**Fórmula/función**

</td></tr><tr><td style="width: 561px;"><span style="font-weight: 400;">Convertir grados Fahrenheit a Celsius</span>

</td><td style="width: 248px;"><span style="font-weight: 400;">(</span>**X**<span style="font-weight: 400;">\*(9/5))+32</span>

</td></tr><tr><td style="width: 561px;"><span style="font-weight: 400;">Mover el punto decimal una posición a la izquierda</span>

</td><td style="width: 248px;">**X**<span style="font-weight: 400;">/10</span>

</td></tr><tr><td style="width: 561px;"><span style="font-weight: 400;">Mover el punto decimal una posición a la derecha</span>

</td><td style="width: 248px;">**X**<span style="font-weight: 400;">\*10</span>

</td></tr><tr><td style="width: 561px;"><span style="font-weight: 400;">Convertir un entero a texto. </span>**X**<span style="font-weight: 400;"> y </span>**Y**<span style="font-weight: 400;"> = valores a modificar, entre comillas se agrega el </span>**TEXTO**<span style="font-weight: 400;"> deseado</span>

</td><td style="width: 248px;"><span style="font-weight: 400;">Compare(</span>**X**<span style="font-weight: 400;">: '</span>**TEXTO**<span style="font-weight: 400;">'; </span>**Y**<span style="font-weight: 400;">: '</span>**TEXTO2**<span style="font-weight: 400;">')</span>

</td></tr><tr><td style="width: 561px;"><span style="font-weight: 400;">Convertir valor hexadecimal a decimal</span>

</td><td style="width: 248px;"><span style="font-weight: 400;">hexdec(</span>**X**<span style="font-weight: 400;">)</span>

</td></tr><tr><td style="width: 561px;"><span style="font-weight: 400;">Negar valores. Por ejemplo: de 1 pasa a 0 y de 0 a 1</span>

</td><td style="width: 248px;"><span style="font-weight: 400;">negation(</span>**X**<span style="font-weight: 400;">)</span>

</td></tr><tr><td style="width: 561px;"><span style="font-weight: 400;">Soportar valores negativos en sensores de temperatura</span>

</td><td style="width: 248px;"><span style="font-weight: 400;">dec2signfloat(</span>**X**<span style="font-weight: 400;">)</span>

</td></tr><tr><td style="width: 561px;"><span style="font-weight: 400;">Multiplicar lo calculado del sensor de temperatura por el valor (</span>**Y**<span style="font-weight: 400;">) indicado por el fabricante</span>

</td><td style="width: 248px;"><span style="font-weight: 400;">dec2signfloat(</span>**X**<span style="font-weight: 400;">)\*</span>**Y**

</td></tr><tr><td style="width: 561px;"><span style="font-weight: 400;">Convertir la latitud/longitud de grados decimales a grados, minutos y segundos </span>

</td><td style="width: 248px;"><span style="font-weight: 400;">ddtodms(</span>**X**<span style="font-weight: 400;">)</span>

</td></tr></tbody></table>