MCPcopy Index your code
hub / github.com/TypeScriptToLua/TypeScriptToLua / toFixed

Function toFixed

benchmark/src/util.ts:3–5  ·  view source on GitHub ↗
(num: number, decimalPlaces = 0)

Source from the content-addressed store, hash-verified

1import { BenchmarkFunction } from "./benchmark_types";
2
3export function toFixed(num: number, decimalPlaces = 0): string {
4 return string.format(`%.${decimalPlaces}f`, num);
5}
6
7export function calculatePercentageChange(oldValue: number, newValue: number): number {
8 return (newValue / oldValue) * 100 - 100;

Callers 3

compareRuntimeBenchmarksFunction · 0.90
compareNumericBenchmarksFunction · 0.90
formatMemoryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected