Improved display format for transfer fee
This commit is contained in:
parent
0319932f28
commit
4ff1dcf179
@ -1,4 +1,12 @@
|
||||
class Token < ActiveRecord::Base
|
||||
enum standard: [:dip20, :icrc1, :unknown]
|
||||
validates :canister_id, presence: true, uniqueness: true
|
||||
|
||||
def transfer_fee_to_f
|
||||
if self.transfer_fee.present?
|
||||
return self.transfer_fee/(10.0**self.decimals)
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
%td= token.name
|
||||
%td= token.total_supply
|
||||
%td= token.decimals
|
||||
%td= token.transfer_fee
|
||||
%td= token.transfer_fee_to_f
|
||||
- if policy(token).update?
|
||||
%td= link_to 'Show', token
|
||||
%td= link_to 'Edit', edit_token_path(token)
|
||||
|
||||
@ -31,7 +31,5 @@
|
||||
= @token.decimals
|
||||
%p
|
||||
%b Transfer fee:
|
||||
- begin
|
||||
= @token.transfer_fee/(10.0**@token.decimals)
|
||||
- rescue
|
||||
= @token.transfer_fee_to_f
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user