Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2021-02

Value:x:y syntax

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Luis Henrique
Luis Henrique wrote
At https://lists.freepascal.org/pipermail/fpc-devel/2021-February/043569.html I saw the syntax "value: x: y". > str(value:6:3, valuestr); What is the name of this and where is it documented?

It is documented in the official documentation:

https://www.freepascal.org/docs-html/current/rtl/system/str.html

The write procedure also supports these formatting options, they are also documented:

https://www.freepascal.org/docs-html/current/rtl/system/write.html

Michael.

Christo Crause
to Luis Henrique: At https://lists.freepascal.org/pipermail/fpc-devel/2021-February/043569.html I saw the…

On Tue, Feb 9, 2021 at 2:11 PM Luis Henrique via fpc-pascal <

Show quoted text 10 lines
wrote: At https://lists.freepascal.org/pipermail/fpc-devel/2021-February/043569.html I saw the syntax "value: x: y". > str(value:6:3, valuestr); What is the name of this and where is it documented? I did tests and saw that Y determines the width of the precision part, but I can't see any effect of X.

I guess one can call it optional formatting specifiers. See documentation: https://www.freepascal.org/docs-html/rtl/system/str.html

Luis Henrique
to Christo Crause

09.02.2021, 09:15, "Christo Crause" :

Show quoted text 7 lines
On Tue, Feb 9, 2021 at 2:11 PM Luis Henrique via fpc-pascal wrote: > At https://lists.freepascal.org/pipermail/fpc-devel/2021-February/043569.html I saw the syntax "value: x: y". >> str(value:6:3, valuestr); > What is the name of this and where is it documented? > I did tests and saw that Y determines the width of the precision part, but I can't see any effect of X. I guess one can call it optional formatting specifiers.  See documentation: https://www.freepascal.org/docs-html/rtl/system/str.html

I think I was lazy and didn't look in the right place, thanks Michael and Christo.