Community discussions

MikroTik App
 
majdichebil
just joined
Topic Author
Posts: 6
Joined: Mon Nov 08, 2021 9:03 am

Hexadecimal_To_Decimal

Tue Nov 09, 2021 11:38 am

Hello everyone,

I am trying to convert hexadecimal to decimal number using a script code but I have found some troubles doing that as I am still new to routerOs.

Any help pls.

Thanks
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1071
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Hexadecimal_To_Decimal

Sun Nov 14, 2021 11:10 pm

RouterOS does it for you:
[admin@MikroTik] > :put [ :tonum 0xff ]
255
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12003
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Hexadecimal_To_Decimal

Mon Nov 15, 2021 2:42 am

# the octet is case insensitive
:global octet "f"
:put [:tonum "0x$octet"]
 
majdichebil
just joined
Topic Author
Posts: 6
Joined: Mon Nov 08, 2021 9:03 am

Re: Hexadecimal_To_Decimal

Mon Nov 15, 2021 11:30 am

Thank you very much!!
And I hope u can help with the other post which is about reading the data from RS485
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12003
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Hexadecimal_To_Decimal

Mon Nov 15, 2021 5:36 pm

For me is impossible, I do not have that hardware to test

Who is online

Users browsing this forum: No registered users and 24 guests