Skip to content

Commit ef6ef85

Browse files
committed
エラーメッセージの浮動小数点が指数表記になるケースがあったのを通常表示に変更した。
1 parent 87ddfa8 commit ef6ef85

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

petitnote/template/basic/paint_klecks.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@
139139
}
140140
Promise.all([klecks.getPNG(), klecks.getPSD()]).then(([png, psd]) => {
141141
const TotalSiz = ((png.size + psd.size) / 1024 / 1024).toFixed(3);
142-
if (<?= h($max_pch)?> && TotalSiz > <?= h($max_pch) ?>) {
143-
return alert(`<?php if ($en): ?>File size is too large.<?php else: ?>ファイルサイズが大きすぎます。<?php endif; ?>\n<?php if ($en): ?>limit size<?php else: ?>制限値<?php endif; ?>:<?= h($max_pch) ?>MB\n<?php if ($en): ?>Current size<?php else: ?>現在値<?php endif; ?>:${TotalSiz}MB`)
142+
const max_pch = Number(<?= h($max_pch) ?>); // 最大サイズ
143+
if (max_pch && TotalSiz > max_pch) {
144+
return alert(`<?php if ($en): ?>File size is too large.<?php else: ?>ファイルサイズが大きすぎます。<?php endif; ?>\n<?php if ($en): ?>limit size<?php else: ?>制限値<?php endif; ?>:${max_pch}MB\n<?php if ($en): ?>Current size<?php else: ?>現在値<?php endif; ?>:${TotalSiz}MB`)
144145
}
145146
const formData = new FormData();
146147
formData.append("picture", png, 'blob');

0 commit comments

Comments
 (0)