Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 03/09/2013
Components: Language
Versions: 10.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: Final /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Platforms All
Vote Count: 3
CFML has yesNoFormat() which is lovely, but a bit arcane. Most people think true/false 1/0 for booleans I think (except CFML, which often returns yes/no from its built-in functions for some reason).
To work around this quirk of CFML, it'd be handly to have a booleanFormat() function (analogous to numberFormat() for numbers) which works along these lines:
booleanFormat(booleanValue); // returns true or false as appropriate
booleanFormat(booleanValue, "TRUEFALSE"); // returns true or false as appropriate
booleanFormat(booleanValue, "YESNO"); // returns "yes" or "no" as appropriate (or maybe a locale specific version of same? Dunno)
booleanFormat(booleanValue, "ONEZERO"); // returns 1 or 0 as appropriate
I'm not married to the approach I've suggested the mask takes, but something along those lines.
This would not be the most useful function ever, but I have had a number of occasions when interchanging data with other systems wherein I've needed more control over boolean values like this.
--
Adam
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3516706
External Customer Info:
External Company:
External Customer Name: Adam Cameron.
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: