View Full Version : number formats for variables
dteman
2010-02-06, 08:42 AM
How can I control the format, including the number of decimal places shown, for a variable, like the LineLength? There have been examples of date formats, but none of the Cocoa number formats I've tried work on floating point numbers. Without this control, Omnigraffle often displays numbers like 20.0002 or 19.9996, instead of simply rounding to 20.0.
whpalmer4
2010-02-06, 08:10 PM
I suspect the issue is that the variables are all strings...
dteman
2010-02-07, 06:11 AM
I suspect the issue is that the variables are all strings...
Yes. So why does formatting strings work for the month variable (see comment by "Ape" on http://forums.omnigroup.com/showthread.php?t=2708&highlight=variables+format), but not for the lineLength variable?
whpalmer4
2010-02-07, 08:50 AM
Yes. So why does formatting strings work for the month variable (see comment by "Ape" on http://forums.omnigroup.com/showthread.php?t=2708&highlight=variables+format), but not for the lineLength variable?
Everyone is likely to want to control the formatting of dates, so they put in support for that. I doubt it even occurred to anyone that someone was going to want to use a format specifier on a line length!
In hindsight, I'll admit my answer wasn't the best -- I was thinking about the case of userdata where the values are strings even if numeric. Might not be unreasonable to ask that you get the chance to apply a format specifier to something like the line length variable which is a number internally, but expecting OG to parse numeric userdata so you can turn around and round it off might be a feature request that takes a very long time to get to the top of the pile!
To get that feature request, or any other feature request, in front of the Omni developers, use Help->Send Feedback or email omnigraffle@omnigroup.com. That way it will be tracked and entered in the database. A forum posting right before Macworld and with everyone busily trying to figure out how to move all of the Omni products to the iPad stands a better than usual chance of being missed, I'll wager...
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.