开发者

Aligning decimal numbers in Flex datagrid column

开发者 https://www.devze.com 2023-04-12 12:06 出处:网络
The dataProvider for my Flex DataGridColumn contains numbers wit开发者_如何学编程h various number of decimals. For example: 0.45, 122.3, 0.003

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

精彩评论

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