MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / convertNumberField

Method convertNumberField

internal/search/search.go:330–340  ·  view source on GitHub ↗

convertNumberField converts a single numeric field to string format

(data map[string]interface{}, field string)

Source from the content-addressed store, hash-verified

328
329// convertNumberField converts a single numeric field to string format
330func (t *TypesenseClient) convertNumberField(data map[string]interface{}, field string) {
331 if val, ok := data[field]; ok {
332 switch v := val.(type) {
333 case *big.Int:
334 data[field] = v.String()
335 case float64:
336 // Convert scientific notation back to integer string
337 data[field] = fmt.Sprintf("%.0f", v)
338 }
339 }
340}
341
342// ensureSchemaFields ensures all required schema fields are present with default values
343func (t *TypesenseClient) ensureSchemaFields(config CollectionConfig, data map[string]interface{}) {

Calls

no outgoing calls