Skip to content

Commit

Permalink
release: 0.6.5 (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb authored Jun 23, 2024
2 parents b2eb143 + 3f0ca14 commit 4a0d1a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/kotlin/org/gitanimals/render/domain/PersonaType.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.gitanimals.render.domain

import java.math.RoundingMode
import java.text.DecimalFormat
import kotlin.math.atan2
import kotlin.math.max
Expand Down Expand Up @@ -1237,7 +1238,7 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null)
}

private fun loadDropRate(): String {
val allPersonaCount = personas.size
val allPersonaCount = personas.filter { it.weight > 0.0 }.size
val personaCount = (weight * 1000).toInt()

val dropRateTemp = (personaCount.toDouble() / allPersonaCount.toDouble()) * 100.0
Expand Down Expand Up @@ -1287,7 +1288,7 @@ enum class PersonaType(val weight: Double, private var dropRate: String? = null)
}

companion object {
private val dropRateFormat = DecimalFormat("#.#")
private val dropRateFormat = DecimalFormat("#.##")

private val maxWeight = lazy {
var maxWeight = 0
Expand Down

0 comments on commit 4a0d1a6

Please sign in to comment.