开发者

Aligning decimal numbers in Flex datagrid column

The dataProvider for my Flex DataGridColumn contains numbers wit开发者_如何学编程h various number of decimals. For example: 0.45, 122.3, 0.003

How can I show the numbers aligned with respect to their decimal point (i.e. the decimal points are aligned vertically in the column) ?


To solve your issue, you'll need to write your custom itemRenderer. In this renderer I'd suggest you to split your numbers with point into parts (example "0.45" -> "0" and ".45"), create Label for each part and try to align right parts (with point) identically. And then join the left part.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜