freepascal - Pascal 中的三位实数

标签 freepascal digit

我有 Free pascal 代码,我有来自 a/b 的实数 3.285714287142857E+000。

program threedigits;
var a,b:real;

begin
a:=23;
b:=7;
writeln(a/b);
end.

逗号(3.286)后面的数字怎么改成三位数?

最佳答案

使用 0:3

var a,b:real;

begin
a:=23;
b:=7;
writeln(a/b:0:3);

readln;
end.

关于freepascal - Pascal 中的三位实数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41565482/

相关文章:

delphi - Indy10 自由帕斯卡

windows - Windows 7 上的多播套接字

delphi - FPC BASM32 MUL 错误?

c - C 中 isdigit() 的段错误?

r - 更改 Venndiagram 中数字的位数

delphi - 使用 Delphi 打开 URL

pascal - 有没有办法确定对对象过程的引用是否对应于 Pascal 中的对象实例?

正则表达式:匹配字符串中任意位置的 "year:2012"?

c# - 如何比较 int 的最后一位数字并删除具有相同最后一位数字的项目?

Java 整数数字读取器