你好
我正在嘗試對數字進行四捨五入,但遇到了一些麻煩。 例如。 我有數字 0.915 和 0.915000021 我嘗試使用精確度和固定 Dec 將 0.915000021 舍入到 0.915。 但是,在我使用精度或固定十進制後,.915000021 保持不變。 我有什麼想法可以改變這件事嗎? 此外,還有多個這樣的實例,因此編輯該列對我來說是最好的解決方案。
我可以複製該列並使用公式對所有內容進行四捨五入,然後貼上它並刪除原始列嗎?
任何建議將不勝感激。


聯合管理計劃數字格式改變資料的顯示方式,但不改變潛在的價值。 也許您需要“Round()”函數,但與往常一樣,您在修改資料值本身時應該小心謹慎。 將下面的程式碼複製並貼上到腳本視窗中,執行“編輯>運行腳本”,然後查看公式列:
New Table( "Formats and Rounding",
Add Rows( 10 ),
New Column( "Precise Value",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Random Normal() )
),
New Column( "Precise Value with 'Fixed Dec' Format",
Numeric,
"Continuous",
Format( "Fixed Dec", 12, 2 ),
Formula( :Precise Value )
),
New Column( "Precise Value with 'Precision' Format",
Numeric,
"Continuous",
Format( "Precision", 12, 2 ),
Formula( :Precise Value )
),
New Column( "Precise Value Rounded to 2 Decimal Places",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Round( :Precise Value, 2 ) )
)
)