--- title: fromDecimal description: "Converts a number or numeric string into its hexadecimal string representation." keywords: ["fromdecimal", "utils", "decimal to hex", "hexadecimal", "number conversion", "tronweb"] --- # fromDecimal Converts a number, or a string of numbers, into a hexadecimal string. ### Usage ```javascript TronWeb.fromDecimal(number); ``` ### Parameters | Parameter | Description | Data Type | | --------- | ---------------- | --------------------------- | | number | String or Number | Hexadecimal string / Number | ### Returns String - The converted hex string. ### Example ```javascript TronWeb.fromDecimal("12345678"); // output-start '0xbc614e' // output-end ```