--- title: fromSun description: "Converts a value expressed in SUN to TRX, where 1 SUN equals 0.000001 TRX, returning the TRX value as a string." keywords: ["fromsun", "utils", "sun to trx", "convert units", "tronweb"] --- # fromSun Helper function that will convert a value in SUN to TRX (1 SUN = 0.000001 TRX). If you want to convert a value in TRX to SUN, `toSun` is available. ### Usage ```JavaScript TronWeb.fromSun(value) ``` ### Parameters | Parameter | Description | Data Type | | --------- | ------------ | --------- | | value | The value in SUN | String | ### Returns String - The converted TRX value. ### Example ```JavaScript TronWeb.fromSun("1000000") // output-start '1' // output-end ```