I have code in Free pascal, I have real number 3.285714287142857E+000 from a/b.
program threedigits;
var a,b:real;
begin
a:=23;
b:=7;
writeln(a/b);
end.
How to change the number to three digits after comma (3.286)?
Use 0:3
var a,b:real;
begin
a:=23;
b:=7;
writeln(a/b:0:3);
readln;
end.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With