MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / _parseFloatSafe

Method _parseFloatSafe

packages/alphatab/src/importer/GpifParser.ts:344–354  ·  view source on GitHub ↗
(text: string | undefined, fallback: number)

Source from the content-addressed store, hash-verified

342 }
343
344 private static _parseFloatSafe(text: string | undefined, fallback: number) {
345 if (!text) {
346 return fallback;
347 }
348
349 const i = Number.parseFloat(text);
350 if (!Number.isNaN(i)) {
351 return i;
352 }
353 return fallback;
354 }
355
356 private static _splitSafe(text: string | undefined, separator: string = ' '): string[] {
357 if (!text) {

Callers 8

_parseAutomationMethod · 0.80
_parseFermataMethod · 0.80
_parseBeatMethod · 0.80
_parseBarXPropertiesMethod · 0.80
_parseBeatPropertiesMethod · 0.80
_parseNotePropertiesMethod · 0.80

Calls 2

parseFloatMethod · 0.80
isNaNMethod · 0.80

Tested by

no test coverage detected