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