Skip to content

Commit aa86083

Browse files
Fix issue: rounding float value for txpower and rxpower (sonic-net#320)
- Description For cmis cable, tx power and rx power is not rounding as other eeprom fields - Motivation and Context Fix issue: rounding float value for txpower and rxpower - How Has This Been Tested? Manual test
1 parent 2052a63 commit aa86083

File tree

1 file changed

+2
-2
lines changed
  • sonic_platform_base/sonic_xcvr/api/public

1 file changed

+2
-2
lines changed

sonic_platform_base/sonic_xcvr/api/public/cmis.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ def get_transceiver_bulk_status(self):
208208
for i in range(1, self.NUM_CHANNELS + 1):
209209
bulk_status["tx%ddisable" % i] = tx_disable[i-1] if self.get_tx_disable_support() else 'N/A'
210210
bulk_status["tx%dbias" % i] = tx_bias['LaserBiasTx%dField' % i] if self.get_tx_bias_support() else 'N/A'
211-
bulk_status["rx%dpower" % i] = self.mw_to_dbm(rx_power[i - 1]) if self.get_rx_power_support() else 'N/A'
212-
bulk_status["tx%dpower" % i] = self.mw_to_dbm(tx_power[i - 1]) if self.get_tx_power_support() else 'N/A'
211+
bulk_status["rx%dpower" % i] = float("{:.3f}".format(self.mw_to_dbm(rx_power[i - 1]))) if self.get_rx_power_support() else 'N/A'
212+
bulk_status["tx%dpower" % i] = float("{:.3f}".format(self.mw_to_dbm(tx_power[i - 1]))) if self.get_tx_power_support() else 'N/A'
213213

214214
laser_temp_dict = self.get_laser_temperature()
215215
self.vdm_dict = self.get_vdm()

0 commit comments

Comments
 (0)