Skip to content

Commit

Permalink
added default value for convertHex
Browse files Browse the repository at this point in the history
  • Loading branch information
synasapmob committed Oct 17, 2023
1 parent 550da02 commit 8754c91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { InjectedWindowProvider } from 'types/polkadot.type';
convert to 'base 16'
the latest adding alpha
*/
export const convertHex = (color: string, opacity: number) => {
export const convertHex = (color: string, opacity = 1) => {
const hexColorToRGBA = `${parseInt(color.substring(1, 3), 16)}, ${parseInt(
color.substring(3, 5),
16
Expand Down Expand Up @@ -72,7 +72,7 @@ export const formatCurrency = (value: number, currency?: string) => {
};

export const unitGAFI = (fee: string) => {
return fee.replace('.', '') + '0'.repeat(chainDecimal);
return fee.replace('.', '') + '0'.repeat(chainDecimal - 1);
};

export const ColorOfRarity = (weight: number | string) => {
Expand Down

0 comments on commit 8754c91

Please sign in to comment.