Skip to content

Commit

Permalink
replaced precision from .2f to g
Browse files Browse the repository at this point in the history
  • Loading branch information
WayneDroid committed May 7, 2024
1 parent 7161667 commit 6eaaef8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/analog_out/cont_gen_voltage_wfm_int_clk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6eaaef8

Please sign in to comment.