From 6eaaef8666562bbd84e4b99d9f61c6dcd6db782f Mon Sep 17 00:00:00 2001 From: Joo Liang Cheah Date: Tue, 7 May 2024 11:39:49 +0800 Subject: [PATCH] replaced precision from .2f to g --- examples/analog_out/cont_gen_voltage_wfm_int_clk.py | 2 +- .../cont_gen_voltage_wfm_int_clk_every_n_samples_event.py | 2 +- examples/analog_out/cont_gen_voltage_wfm_int_clk_non_regen.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/analog_out/cont_gen_voltage_wfm_int_clk.py b/examples/analog_out/cont_gen_voltage_wfm_int_clk.py index 6925fa6b..d4037249 100644 --- a/examples/analog_out/cont_gen_voltage_wfm_int_clk.py +++ b/examples/analog_out/cont_gen_voltage_wfm_int_clk.py @@ -28,7 +28,7 @@ def main(): task.timing.cfg_samp_clk_timing(sampling_rate, sample_mode=AcquisitionType.CONTINUOUS) actual_sampling_rate = task.timing.samp_clk_rate - print(f"Actual sampling rate: {actual_sampling_rate:.2f} S/s") + print(f"Actual sampling rate: {actual_sampling_rate:g} S/s") data = create_sine_wave( frequency=10.0, amplitude=1.0, sampling_rate=actual_sampling_rate, duration=1.0 diff --git a/examples/analog_out/cont_gen_voltage_wfm_int_clk_every_n_samples_event.py b/examples/analog_out/cont_gen_voltage_wfm_int_clk_every_n_samples_event.py index dc225e60..7675a116 100644 --- a/examples/analog_out/cont_gen_voltage_wfm_int_clk_every_n_samples_event.py +++ b/examples/analog_out/cont_gen_voltage_wfm_int_clk_every_n_samples_event.py @@ -41,7 +41,7 @@ def callback(task_handle, every_n_samples_event_type, number_of_samples, callbac task.register_every_n_samples_transferred_from_buffer_event(1000, callback) actual_sampling_rate = task.timing.samp_clk_rate - print(f"Actual sampling rate: {actual_sampling_rate:.2f} S/s") + print(f"Actual sampling rate: {actual_sampling_rate:g} S/s") data = create_sine_wave( frequency=10.0, amplitude=1.0, sampling_rate=sampling_rate, duration=1.0 diff --git a/examples/analog_out/cont_gen_voltage_wfm_int_clk_non_regen.py b/examples/analog_out/cont_gen_voltage_wfm_int_clk_non_regen.py index 5e1de83a..05367a4b 100644 --- a/examples/analog_out/cont_gen_voltage_wfm_int_clk_non_regen.py +++ b/examples/analog_out/cont_gen_voltage_wfm_int_clk_non_regen.py @@ -39,7 +39,7 @@ def main(): task.timing.cfg_samp_clk_timing(sampling_rate, sample_mode=AcquisitionType.CONTINUOUS) actual_sampling_rate = task.timing.samp_clk_rate - print(f"Actual sampling rate: {actual_sampling_rate:.2f} S/s") + print(f"Actual sampling rate: {actual_sampling_rate:g} S/s") try: full_cycle = 2.0