# How to convert AssetId to string with 0x prefix?

**URL:** <https://forum.fuel.network/t/how-to-convert-assetid-to-string-with-0x-prefix/2242>\
**Category:** Rust SDK\
**Created:** [April 4, 2023, 5:31pm UTC](https://forum.fuel.network/t/how-to-convert-assetid-to-string-with-0x-prefix/2242 "2023-04-04T17:31:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [April 4, 2023, 5:31pm UTC](https://forum.fuel.network/t/how-to-convert-assetid-to-string-with-0x-prefix/2242/1 "2023-04-04T17:31:47Z")

</div>

Hi guys  
I need to save AssetId in `0x...` format but `asset_id.to_string()` gives me part without `0x` and I forced to use `format!("0x{}", usdc.contract_id().hash)`  
Is there any more elegant way to do it?
