MCPcopy Create free account
hub / github.com/Effect-TS/effect / digitAt

Function digitAt

packages/sql/pg/src/PgTypes.ts:738–742  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

736 // Groups outside 0-9999 have no four-digit text, and reading past the ones
737 // the value carries is how the fractional part is padded out.
738 const digitAt = (index: number): number => {
739 if (index < 0 || index >= count) return 0
740 const digit = readInt16(bytes, digits + index * 2)
741 return digit >= 0 && digit <= 9999 ? digit : fail(`Invalid numeric digit: ${digit}`)
742 }
743
744 let result = sign === NUMERIC_NEG ? "-" : ""
745 if (weight < 0) {

Callers 2

decodeNumericFunction · 0.85
BigDecimal.tsFile · 0.85

Calls 2

readInt16Function · 0.85
failFunction · 0.70

Tested by

no test coverage detected