diff --git a/src/helper.js b/src/helper.js new file mode 100644 index 00000000..9f7b2205 --- /dev/null +++ b/src/helper.js @@ -0,0 +1,7 @@ +export function formatStat(value, type) { + if (type !== 'em') { + return `${Math.round(value * 100 * 10) / 10}%`; + } + + return Math.round(value); +} diff --git a/src/locales/en.json b/src/locales/en.json index b2b6b276..494a83f3 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -109,6 +109,7 @@ "geoDamageBonus": "Geo DMG Bonus", "sortBy": "Sort by...", "talentBook": "Talent Book", + "bossItem": "Boss", "ascensionMaterial": "Ascension Materials", "talentStats": "Talent Stats", "build": "Build", diff --git a/src/routes/characters/[id].svelte b/src/routes/characters/[id].svelte index 05d7a249..ac8a885d 100644 --- a/src/routes/characters/[id].svelte +++ b/src/routes/characters/[id].svelte @@ -31,6 +31,7 @@ import artifacts from '../../data/artifacts/en.json'; import weapons from '../../data/weapons/en.json'; import Ad from '../../components/Ad.svelte'; + import { formatStat } from '../../helper'; const rarityColor = { 1: 'text-white', @@ -94,6 +95,7 @@ const bookId = character.material.book[0].id; const book = itemGroup[bookId]; const materials = character.ascension[1].items; + const bossItem = character.material.boss; let chars = {}; let constellationCount = -1; @@ -253,13 +255,28 @@

{data.description}

-
-

{$t('characters.talentBook')}

-