Format Function RTC

10. Oktober 2011 10:37

Hallo!
ich habe leider noch nicht mit der Funktion FORMAT gemacht, deshalb habe hier ein wenig im Forum geschaut habe auch was gefunden jedoch ohne Erklärung,
Kann mir jemand die einzelnen Elemente dieser Zeile erklären und wofür das steht.

FORMAT(Rec.Betrag,0,'<Precision,2:2><Standard Format,0>');

Was bedeutet die 0 oder <Precision, 2:2> usw.

Danke

Re: Format Function RTC

10. Oktober 2011 10:45

Ich kann mich nur wiederholen:

Wirf einen Blick in die Onlinehilfe (C/SIDE Reference Guide, nur im CC aufzurufen). Da (im Artikel "Format property") stehts geschrieben


Beginne beim Artikel zu FORMAT, dann Format property.
Was genau am Onlinehilfeartikel bereitet dir Verständnisschwierigkeiten?

Re: Format Function RTC

10. Oktober 2011 11:15

dort steht nichts geschrieben über Precision

Re: Format Function RTC

10. Oktober 2011 12:29

prinzessin88 hat geschrieben:dort steht nichts geschrieben über Precision

Sieht dein Artikel anders aus als meiner? ;-)
Format Property
Abschnitt Example
[...]<Precision,2:3><Standard Format,0> will use Standard Format 0 and will format the data with a minimum of 2 and a maximum of 3 decimal places. See also the DecimalPlaces Property.[...]


Versteh mich bitte nicht falsch; aber dieser "Drang" zur Selbsthilfe ist sehr wichtig. Auch langjährige C/AL-Programmierer müssen immer wieder nachschlagen und akzeptieren, dass diese Artikel ggf. sehr sorgfältig zu lesen sind.

Re: Format Function RTC

10. Oktober 2011 13:25

Hallo,

kannst du nicht im Code einfach mit F1 die Hilfe abrufen und dort nach Format Funktion suchen?

Bei mir steht z.B. Folgendes:


Formats a value into a string.


String := FORMAT(Value[, Length][, FormatStr/FormatNumber])



Parameters
Value
Type: Any

This is a C/AL variable (expression) of any simple data type, such as option, integer, biginteger, decimal, char, text, code, date, time, datetime, Boolean, binary, or GUID.

If, when the system formats Value, the result is a value larger than the maximum length MAXSTRLEN Function (Code, Text) of String, a run-time error occurs.

Length
Type: Integer

This optional parameter specifies the length of String. The following rules apply:

If Length = 0 then the entire value is returned (default).

If Length > 0 then the returned string will be exactly Length characters.

If Value is less than Length characters, then either leading or trailing spaces are inserted, depending on the format that you select.

If Value exceeds Length characters, then String is truncated to Length characters.

If Length < 0 then the returned string will not have leading or trailing spaces.

If Value is less than Length characters, the length of String will equal the length of Value.

If Value exceeds Length characters, then String is truncated to Length characters.

FormatStr
Type: String

A literal string that defines a format as in the Format Property.

FormatNumber
Type: Integer

This optional parameter specifies the format that you want to use. The basic options are the following:

<Sign><Integer Thousand><Decimals> is Format 0

<Sign><Integer><Decimals> is Format 1

<Sign><Integer><Decimals><1000Character,.> is Format 2

<Integer Thousand><Decimals><Sign,1> is Format 3

<Integer><Decimals><Sign,1> is Format 4


Gruß
Aydin

Re: Format Function RTC

23. Oktober 2011 20:43

Gracias por el código que está trabajando.

[Übersetzung: Vielen Dank für den Code, der funktioniert.]
Zuletzt geändert von Timo Lässer am 24. Oktober 2011 10:15, insgesamt 1-mal geändert.
Grund: Übersetzung hinzugefügt