MCPcopy Create free account
hub / github.com/tensorflow/tfjs / getDisplayDecimalPlaces

Function getDisplayDecimalPlaces

tfjs-node/src/callbacks.ts:174–180  ·  view source on GitHub ↗
(x: number)

Source from the content-addressed store, hash-verified

172 * @return Number of decimal places to display for `x`.
173 */
174export function getDisplayDecimalPlaces(x: number): number {
175 if (!Number.isFinite(x) || x === 0 || x > 1 || x < -1) {
176 return BASE_NUM_DIGITS;
177 } else {
178 return BASE_NUM_DIGITS - Math.floor(Math.log10(Math.abs(x)));
179 }
180}
181
182export interface TensorBoardCallbackArgs {
183 /**

Callers 2

callbacks_test.tsFile · 0.90
getSuccinctNumberDisplayFunction · 0.85

Calls 3

isFiniteMethod · 0.80
floorMethod · 0.80
absMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…