How to format float decimals when using Value With Pattern binding?
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.
精彩评论