سؤال

i have some formula:

CONCAT((SUM(X.lot_qty)-SUM(X.reject))/SUM(X.accept)*100,'%') AS Acceptance

but i get result like:

100.0000%

how to get result as 100.00%?

هل كانت مفيدة؟

المحلول

You can use the MySQL ROUND function as:

CONCAT(ROUND((SUM(X.lot_qty)-SUM(X.reject))/SUM(X.accept)*100,2),'%') AS Acceptance
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top