Re: [fpc-pascal] Formatting Question

2021-04-04 Thread James Richters via fpc-pascal
0.5 2.53 12.5 Thanks! That’s exactly that I was looking for. Thank you for sharing your code! James ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Formatting Question

2021-04-04 Thread James Richters via fpc-pascal
tomation.net (813)-763-1110 From: fpc-pascal On Behalf Of Jean SUZINEAU via fpc-pascal Sent: Saturday, April 3, 2021 4:41 PM To: fpc-pascal@lists.freepascal.org Cc: Jean SUZINEAU Subject: Re: [fpc-pascal] Formatting Question Normally something like this should do the t

Re: [fpc-pascal] Formatting Question

2021-04-04 Thread Jean SUZINEAU via fpc-pascal
Le 04/04/2021 à 02:41, James Richters a écrit : That looks almost perfect.. can I suppress the trailing zeros with the format command without losing the alignment? As far as I know, no ... Not  with just the RTL. Anyway I have personal code for this, you can extract and customize it to

Re: [fpc-pascal] Formatting Question

2021-04-03 Thread Jean SUZINEAU via fpc-pascal
Normally something like this should do the trick (here 3 decimals and 7 characters for total width): program Format_Example; uses     sysutils; procedure F( _d: double); var    S: String; begin S:= Format('%7.3f',[_d]); WriteLn( S); end; begin F(0.5); F(2.53); F(12.5);

Re: [fpc-pascal] Formatting Question

2021-04-03 Thread Vojtěch Čihák via fpc-pascal
James Richters via fpc-pascal" Komu: "'FPC-Pascal users discussions'" Datum: 03.04.2021 17:53 Předmět: [fpc-pascal] Formatting Question I'm looking for a way to format numerical data in a string so that everything ends up aligned by the decimal point. I've been trying to use the For

Re: [fpc-pascal] Formatting Question

2021-04-03 Thread Travis Siegel via fpc-pascal
You can always convert the number to a string, then format it accordingly.  It's probably not the solution you want, but it will do the trick. On 4/3/2021 11:43 AM, James Richters via fpc-pascal wrote: I'm looking for a way to format numerical data in a string so that everything ends up

[fpc-pascal] Formatting Question

2021-04-03 Thread James Richters via fpc-pascal
I'm looking for a way to format numerical data in a string so that everything ends up aligned by the decimal point. I've been trying to use the Format() function but I don't see how to do what I am looking for... then again I don't really understand the format() function, and most of the