我希望在F#中逗号后得到4个数字: 这是我的代码:
// Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help.
open System
[<EntryPoint>]
let main argv =
let num = Console.ReadLine() |> float
Console.WriteLine(num)
Console.Read() |>ignore
0
答案 0 :(得分:3)
这就是结果:
open System
[<EntryPoint>]
let main argv =
let num = Math.Round(Console.ReadLine() |> float, 3)
Console.WriteLine(num)
Console.Read() |>ignore
0