Convert Float To String With Decimals
| | |
| --- | --- |
| | # Returns Number converted to a string, truncated to Decimals places. |
| | ToTruncatedString<public>(Number:float, Decimals:int):[]char= |
| | var Str:[]char = ToString(Number) |
| | if: |
| | DotIndex := Str.Find['.'] |
| | StopIndex := if (Decimals > 0) then Min(DotIndex+Decimals+1,Str.Length) else DotIndex |
| | set Str = Str.Slice[0, StopIndex] |
| | Str |