Deprecate UiTokenAmount::ui_amount (#15616)
* Add TokenAmount::ui_amount_string * Fixup solana-tokens * Update docs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use solana_account_decoder::parse_token::token_amount_to_ui_amount;
|
||||
use solana_account_decoder::parse_token::real_number_string_trimmed;
|
||||
use solana_sdk::native_token::lamports_to_sol;
|
||||
use std::{
|
||||
fmt::{Debug, Display, Formatter, Result},
|
||||
@@ -27,7 +27,7 @@ impl Token {
|
||||
write!(f, "{}{}", SOL_SYMBOL, amount)
|
||||
}
|
||||
TokenType::SplToken => {
|
||||
let amount = token_amount_to_ui_amount(self.amount, self.decimals).ui_amount;
|
||||
let amount = real_number_string_trimmed(self.amount, self.decimals);
|
||||
write!(f, "{} tokens", amount)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user