MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / roundNumbers

Method roundNumbers

service/port/efs.py:717–734  ·  view source on GitHub ↗
(data, digits)

Source from the content-addressed store, hash-verified

715 repairs = EfsPort.getRepairData(fit, sFit)
716
717 def roundNumbers(data, digits):
718 if isinstance(data, str):
719 return
720 if isinstance(data, dict):
721 for key in data:
722 if isinstance(data[key], Number):
723 data[key] = round(data[key], digits)
724 else:
725 roundNumbers(data[key], digits)
726 if isinstance(data, list) or isinstance(data, tuple):
727 for val in data:
728 roundNumbers(val, digits)
729 if isinstance(data, Number):
730 rounded = round(data, digits)
731 if data != rounded:
732 pyfalog.error("Error rounding numbers for EFS export, export may be inconsistent."
733 "This suggests the format has been broken somewhere.")
734 return
735
736 try:
737 dataDict = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected