diff --git a/app/views/metapurses/show.html.haml b/app/views/metapurses/show.html.haml index 8a076292..3ae59a25 100644 --- a/app/views/metapurses/show.html.haml +++ b/app/views/metapurses/show.html.haml @@ -24,6 +24,7 @@ -# = icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[0] = icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[0].scan(/token0Symbol = \"(.*)\"; /)[0][0] rescue nil - value = icpswap_pool_data_raw.split("record {").select{|pool| !pool.scan(canister_id).empty? && !pool.scan(icp_canister_id).empty? }[0].scan(/token0Price = [+-]?([1-9]\d*|0)(\.\d+)?/).join.to_f rescue nil + = "$#{value.round(2)}" - value_amount = (value * amount).round(2) rescue 0 $#{number_with_delimiter(value_amount)} USD - total_value += value_amount rescue 0