Platforms to show: All Mac Windows Linux Cross-Platform
FormatMBS(format as string, value as Double, locale as string = "") as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
global method | Currency, Date and Time Format | MBS Util Plugin | 13.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
locale is the name of the locale to use. You can pass empty string to use default/current locale.
Format is a format string like for printf command in C.
The FormatMBS formats the value under control of the format. The format is a character string which contains three types of objects: plain characters, which are simply copied to standard output, character escape sequences which are converted and copied to the standard output, and format specifications, each of which causes printing of the next successive argument.
Character escape sequences are in backslash notation as defined in the ANSI X3.159-1989 ("ANSI C89"), with extensions. The characters and their meanings are as follows:
\a | Write a <bell> character. |
\b | Write a <backspace> character. |
\c | Ignore remaining characters in this string. |
\f | Write a <form-feed> character. |
\n | Write a <new-line> character. |
\r | Write a <carriage return> character. |
\t | Write a <tab> character. |
\v | Write a <vertical tab> character. |
\' | Write a <single quote> character. |
\\ | Write a backslash character. |
\num or \0num | Write an 8-bit character whose ASCII value is the 1-, 2-, or 3-digit octal number num. |
Each format specification is introduced by the percent character (''%''). The remainder of the format specification includes, in the following order:
Zero or more of the following flags:
Some examples using this global method:
- /Util/Locale/FormatMBS function console
- /Util/Locale/FormatMBS function desktop
- /Util/Locale/FormatMBS function web
Some FAQ entries about this method:
Blog Entries
- Introducing FormatDateMBS function
- MonkeyBread Software Releases the MBS Real Studio plug-ins in version 13.0
- CDbl and Format with locales
- MBS Real Studio Plugins, version 13.0pr2
Xojo Developer Magazine
The items on this page are in the following plugins: MBS Util Plugin.