Kaynağa Gözat

向下取整

jean 1 ay önce
ebeveyn
işleme
c59913b292
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      src/views/staking/config/index.vue

+ 3 - 3
src/views/staking/config/index.vue

@@ -26,11 +26,11 @@ function percentToRatio(percent: number | string | undefined | null): number {
   return p / 100;
 }
 
-/** 100 ÷ 分批周期(%),保留 4 位小数向取整 */
+/** 100 ÷ 分批周期(%),保留 4 位小数向取整 */
 function calcReleasePercentDisplay(period: number | string | undefined | null): string {
   const p = Number(period);
   if (!p || p <= 0 || Number.isNaN(p)) return '0';
-  const pct = Math.ceil((100 / p) * 10000) / 10000;
+  const pct = Math.floor((100 / p) * 10000) / 10000;
   return String(pct);
 }
 
@@ -353,7 +353,7 @@ onMounted(() => {
           <el-input v-model="formData.releaseRate" disabled>
             <template #append>%</template>
           </el-input>
-          <div class="form-tip">自动计算:100 ÷ 分批周期,保留 4 位小数向取整</div>
+          <div class="form-tip">自动计算:100 ÷ 分批周期,保留 4 位小数向取整</div>
         </el-form-item>
         <el-form-item label="描述">
           <el-input v-model="formData.description" type="textarea" />