--- title: toSun description: "Converts a TRX value to its SUN equivalent as a string, where 1 SUN equals 0.000001 TRX." keywords: ["tosun", "utils", "trx to sun", "unit conversion", "tronweb"] --- # toSun Helper function that will convert a value in TRX to SUN. (1 SUN = 0.000001 TRX). ### Usage ```JavaScript TronWeb.toSun(value); ``` ### Parameters | Parameter | Description | Data Type | | --------- | -------------- | --------- | | value | A number value | Number | ### Return String - The value in SUN. ### Example ```JavaScript TronWeb.toSun(10) // output-start "10000000" // output-end ```