On docu pages there are so many mistakes
by all themes around “displayFormats”/“numberFormats”.
Much pages shows a wild mix of old rules and new rules
or old and new behaviors since the last 30 years.
Here for example only one of many pages with mistakes.
// only ok when amount is in same currency
// as system regional individual user parameter
GET SYSTEM FORMAT(Currency symbol;$vCurrSymb)
// The placeholder for decSep in formatString
// is always international neutral “.” since 4Dv11,
// not the same as system regional individual user parameter
// what is idividual and not fix international neutral what 4D needed in formatString
GET SYSTEM FORMAT(Decimal separator;$vDecSep)
// …in next line i must remove two syntax errors,
// removed trash: “###”+
// and on german docu page a plus was missing at: $vDecSep""
// gets wrong result, because my individual decSep from system is set as “,”
// For example, comma is standard-default decSep in germany
// Please remember, decSep placeholder in formatString is automatically replaced by 4D
// in the result by the individual decSep from system regional individual user parameter.
$Result:=String(1234.56;$MyFormat)// -> “€*****12.34”
// ------ Following Lines shows two correct methods ------
// Only this formatStr gets correct results on all systems
// (you see in result my personal decSep is comma)
// The documentation page shows wrong examples and wrong description
// and explains wrong the concept behind 4DformatStrings.
$Result:=String(1234.56;$vCurrSymb+"******.")// -> "€1234,56"
// In some use cases you need in result not the personal decSep from system setting,
// for example you need fix period “.” as decSep in result
// because some rules for xml-export or any payment paper want this.
// Example for result with fix decSep:
$Result:=String(1234.56;$vCurrSymb+“0.00")// -> "€1234,56"
$Result[Length($Result)-2]:="."// -> "€1234.56”
// …there are so many alternatives to get a fix decSep in result,
// but this come never by 4D formatString
// separator placeholders are always like in this pattern “#,##0.00”
// and result use always the personal decSep from system setting.
// Since 4Dv11 this is standard 4D behavior
// when not 4DCompatibilitySetting is set to old DBs behavior num-formats
objectGetFormat and objectSetFormat do not respect listbox from type collection, where one column can have different value-types in every row. The formObjectProperties in form designer you have 4 different formats (alpha/num/date/picture) for this at same time, but with the commands you can set only one. What is the concept of this construction?