小编Pan*_*010的帖子

TableColumn 中的 JavaFX 格式双精度

TableColumn<Product, Double> priceCol = new TableColumn<Product,Double>("Price");
priceCol.setCellValueFactory(new PropertyValueFactory<Product, Double>("price"));
Run Code Online (Sandbox Code Playgroud)

如何格式化此列中的双精度数以保留 2 位小数(因为它们是价格列)?默认情况下,它们仅显示 1 位小数。

java formatting javafx tableview

2
推荐指数
1
解决办法
5750
查看次数

标签 统计

formatting ×1

java ×1

javafx ×1

tableview ×1