# Transformer une colonne de donnees decimals en hexadecimal

**URL:** <https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357>\
**Category:** Ask for Help\
**Created:** [March 19, 2023, 11:05am UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357 "2023-03-19T11:05:25Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![theo\_180280](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theo_180280/32/50049_2.png) [@theo\_180280](https://community.glideapps.com/u/theo_180280)\
**Post date:** [March 19, 2023, 11:05am UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/1 "2023-03-19T11:05:25Z")

</div>

Hi i want to convert decimal data in hexadecimal. Thanks

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [March 19, 2023, 1:47pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/2 "2023-03-19T13:47:32Z")

</div>

Try this in a javascript column. The p1 parameter is the number you want to convert.

```auto
let num = parseFloat(p1);
return num.toString(16);

```

---

<div class="post-metadata">

**Author:** ![theo\_180280](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theo_180280/32/50049_2.png) [@theo\_180280](https://community.glideapps.com/u/theo_180280)\
**Post date:** [March 19, 2023, 2:52pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/3 "2023-03-19T14:52:05Z")

</div>

![16792374963447501298831633312566](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/2/221538a56614ae42e8956c03e1b8187e6544bf95.jpeg)

---

<div class="post-metadata">

**Author:** ![theo\_180280](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theo_180280/32/50049_2.png) [@theo\_180280](https://community.glideapps.com/u/theo_180280)\
**Post date:** [March 19, 2023, 2:52pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/4 "2023-03-19T14:52:40Z")

</div>

I want to convert rfid\_bis in hexadecinal

---

<div class="post-metadata">

**Author:** ![slscustom.ru](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/slscustom.ru/32/77336_2.png) [@slscustom.ru](https://community.glideapps.com/u/slscustom.ru)\
**Post date:** [March 19, 2023, 3:01pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/5 "2023-03-19T15:01:19Z")

</div>

> [@Jeff\_Hager](#):
>
> ```auto
> let num = parseFloat(p1);
> return num.toString(16);
> 
> ```

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/a/7ae6884549f97da5b6595530eddfb7c51ddb9f8c.png)

---

<div class="post-metadata">

**Author:** ![theo\_180280](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theo_180280/32/50049_2.png) [@theo\_180280](https://community.glideapps.com/u/theo_180280)\
**Post date:** [March 20, 2023, 8:14am UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/6 "2023-03-20T08:14:10Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![theo\_180280](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theo_180280/32/50049_2.png) [@theo\_180280](https://community.glideapps.com/u/theo_180280)\
**Post date:** [March 21, 2023, 6:08am UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/7 "2023-03-21T06:08:28Z")

</div>

Hi i have an other problem i want to inverse chiffres for example.  
2F86D431 it s resultant after formula but i need to inverse like this  
F2684D13.  
Thanks

---

<div class="post-metadata">

**Author:** ![slscustom.ru](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/slscustom.ru/32/77336_2.png) [@slscustom.ru](https://community.glideapps.com/u/slscustom.ru)\
**Post date:** [March 21, 2023, 8:12am UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/8 "2023-03-21T08:12:06Z")

</div>

Hi! Do you mean to change digits order? Does the qty of digits every time same?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/e/be67e9b4ae517d3f237331cdb5d98fb282896f19.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [March 21, 2023, 1:42pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/9 "2023-03-21T13:42:56Z")

</div>

```auto
let arrInput = p1.match(/.{1,2}/g);
let i = 0;

while(i < arrInput.length ) {
   arrInput[i] = 
   arrInput[i].split('').reverse().join('');
   i++;
}

return arrInput.join('');

```

---

<div class="post-metadata">

**Author:** ![theo\_180280](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theo_180280/32/50049_2.png) [@theo\_180280](https://community.glideapps.com/u/theo_180280)\
**Post date:** [March 21, 2023, 3:39pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/10 "2023-03-21T15:39:19Z")

</div>

Yes can you show me exactly how you do.thanks

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [March 21, 2023, 3:54pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/11 "2023-03-21T15:54:11Z")

</div>

Create a javascript column, copy and paste the code above and set the p1 parameter to the column that you want to inverse. Exactly the same procedure that @slscustom.ru is showing in his image from a couple days ago.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/6/8658413c382891e0e7a8023ac83d812ac923f495.png)

---

<div class="post-metadata">

**Author:** ![theo\_180280](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theo_180280/32/50049_2.png) [@theo\_180280](https://community.glideapps.com/u/theo_180280)\
**Post date:** [March 22, 2023, 6:11pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/12 "2023-03-22T18:11:51Z")

</div>

thanks i want to obtain

 ![IMG_20230322_191042](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/7/3767d39e5d6cf187b17628e246cf9d5153fdd0fb.jpeg)  
at right it the code with your fomule but i want the code on the left.thanks

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [March 22, 2023, 6:34pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/13 "2023-03-22T18:34:49Z")

</div>

OK, you initially asked to swap every two characters, but now you are saying that you want the entire thing to be reversed?

This should be all you need.

```auto
return p1.split('').reverse().join('');

```

---

<div class="post-metadata">

**Author:** ![Xavier\_Delplanque](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/xavier_delplanque/32/45565_2.png) [@Xavier\_Delplanque](https://community.glideapps.com/u/Xavier_Delplanque)\
**Post date:** [March 22, 2023, 7:13pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/14 "2023-03-22T19:13:35Z")

</div>

It doesn’t look like a shift of the string, but of every couple  
2F 34 30 41 \> 41 30 34 2F  
(A shift would produce 140343F2)

It feels like this should have a name  
A little endian ?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/c/ecbf09a96fd2ae466e81b5e9f1e00871a4c480f8.png)

Would ChatGPT give a correct answer ?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/9/99b93929a3b3aedea642de180b6e2213b1c0cb42.jpeg)

It looks like it’s working

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/5/a5975a17be26aba04f26a65b2c62fcb0fcbd768b.jpeg)

```auto
  let hexStr = p1.toString(16); 
  if (hexStr.length % 2 !== 0) {
    hexStr = '0' + hexStr; 
  }
  let hexBytes = [];
  for (let i = 0; i < hexStr.length; i += 2) {
    hexBytes.unshift(parseInt(hexStr.slice(i, i+2), 16)); 
  }
  return hexBytes.map(b => b.toString(16).padStart(2, '0')).join(''); 

```

---

<div class="post-metadata">

**Author:** ![theo\_180280](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/theo_180280/32/50049_2.png) [@theo\_180280](https://community.glideapps.com/u/theo_180280)\
**Post date:** [March 23, 2023, 1:38pm UTC](https://community.glideapps.com/t/transformer-une-colonne-de-donnees-decimals-en-hexadecimal/59357/15 "2023-03-23T13:38:13Z")

</div>

thanks it s perfect
