开发者

How to format float decimals when using Value With Pattern binding?

开发者 https://www.devze.com 2023-02-17 05:43 出处:网络
I have an NSTextField, which is bound to a float value through Interface Builder via \"Value with Pattern\" field. The default display pattern is %{value1}@

I have an NSTextField, which is bound to a float value through Interface Builder via "Value with Pattern" field. The default display pattern is %{value1}@

Is there any way I can modify that line to have my output formatted to 2 decimal places? Or is that only possible throu开发者_运维知识库gh code?


I've just been trying to do this, as well. You can drag a Number Formatter from the object library on top of the object you want to format. One of the property pages for the formatter allows you to choose from a list of predefined formats, or choose custom and make your own.

0

精彩评论

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