๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’ปTech/๐Ÿ‘จ‍๐Ÿ’ปetc

[JSTL] fmt percent ์†Œ์ˆ˜์  ํ‘œํ˜„

by _viper_ 2016. 4. 28.
๋ฐ˜์‘ํ˜•

โ–ถJSTL์—์„œ fmt:formatNumber type="percent" ์‚ฌ์šฉํ•  ๋•Œ ์†Œ์ˆ˜์  ์ž๋ฆฌ ์ˆ˜ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•

pattern์—๋‹ค๊ฐ€ %๋ฅผ ๋ถ™์—ฌ์ค˜์•ผ ์ œ๋Œ€๋กœ ํ‘œํ˜„๋ฉ๋‹ˆ๋‹ค.

EX ) ์†Œ์ˆ˜์  ํ•œ์ž๋ฆฌ ํ‘œํ˜„
<fmt:formatNumber type="percent" value="0.1"  pattern="0.0%"/>
๊ฒฐ๊ณผ ๊ฐ’ : 10.0%


EX) ์†Œ์ˆ˜์  ๋‘์ž๋ฆฌ ํ‘œํ˜„
<fmt:formatNumber type="percent" value="0.1"  pattern="0.00%"/>
๊ฒฐ๊ณผ ๊ฐ’ : 10.00%