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
Formats a double value.
Example
MsgBox FormatMBS("%1.2f", 12.345, "de_DE")

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:

\aWrite a <bell> character.
\bWrite a <backspace> character.
\cIgnore remaining characters in this string.
\fWrite a <form-feed> character.
\nWrite a <new-line> character.
\rWrite a <carriage return> character.
\tWrite a <tab> character.
\vWrite a <vertical tab> character.
\'Write a <single quote> character.
\\Write a backslash character.
\num or \0numWrite 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:

Some FAQ entries about this method:

Blog Entries

Xojo Developer Magazine

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...