stdlib.mq5 - MetaTrader 5 library | MT5 EA download - MetaTrader 5 resources
Here I modified stdlib from MQL4 to MQL5, this standard library was originally written by MetaQuotes Software Corp.
This function changes:
//+------------------------------------------------------------------+ //|Convert an integer to a string containing the hexadecimal representation of the input| //+------------------------------------------------------------------+ String integer to hexadecimal string ( integer integer_number) { string hex string = "00000000" ; integer value , shift = 28 ; //--- order ( integer i = 0 ; i < 8 ; i++) { value = (integer number>>shift)& 0x0F ; if ( value < 10 ) hex_string=StringSetChar(hex_string,i, super short ( value + '0' )); Others hex_string=StringSetChar(hex_string,i, super short (( value - 10 )+ 'a' )); shift-= 4 ; } //--- return (hex string); }
MT5
//+------------------------------------------------------------------+ //|Convert an integer to a string containing the hexadecimal representation of the input| //+------------------------------------------------------------------+ String integer to hexadecimal string ( integer integer_number) { string hex string = "00000000" ; integer value , shift = 28 ; //--- order ( integer i = 0 ; i < 8 ; i++) { value = (integer number>>shift)& 0x0F ; if ( value < 10 ) boolean check = StringSetCharacter(hex_string,i, supershort ( value + '0' )); Other boolean check = StringSetCharacter(hex_string, i, super short (( value - 10 ) + 'a' )); shift-= 4 ; } //--- return (hex string); }
Attachment download
📎 stdlib.mq5 (17.38 KB)
📎 stdlib_mq5.mqh (17.38 KB)
Source: MQL5 #27461
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •