[PR #293] [MERGED] fix: Trailing 0 and . not trimmed #378

Closed
opened 2026-02-28 00:41:58 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/293
Author: @Tinyblargon
Created: 1/5/2024
Status: Merged
Merged: 1/9/2024
Merged by: @mleone87

Base: masterHead: BugFix-Trim-Trailing-0


📝 Commits (1)

  • 1b7b2d6 fix: Trailing 0 and . not trimmed

📊 Changes

4 files changed (+74 additions, -27 deletions)

View changed files

📝 proxmox/config_qemu_disk.go (+4 -4)
📝 proxmox/config_qemu_test.go (+23 -23)
📝 proxmox/util.go (+9 -0)
📝 proxmox/util_test.go (+38 -0)

📄 Description

The proxmox ui removes trailing 0 and . from floating point numbers, while we do not.
This results in settings in the config being visually different when created by the this library or the proxmox gui.
Example:

  • gui: mbps_rd=10.00
  • library: mbps_rd=10

This changes the formatting so the gui and library produce the same values.

Work done:

  • Created floatToTrimmedString()
  • Added tests for floatToTrimmedString()
  • Updated existing unit test to account for the new number formatting (removed trailing zero)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/293 **Author:** [@Tinyblargon](https://github.com/Tinyblargon) **Created:** 1/5/2024 **Status:** ✅ Merged **Merged:** 1/9/2024 **Merged by:** [@mleone87](https://github.com/mleone87) **Base:** `master` ← **Head:** `BugFix-Trim-Trailing-0` --- ### 📝 Commits (1) - [`1b7b2d6`](https://github.com/Telmate/proxmox-api-go/commit/1b7b2d6d39889e84222eaaabc5c3eff82eb18fa1) fix: Trailing `0` and `.` not trimmed ### 📊 Changes **4 files changed** (+74 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/config_qemu_disk.go` (+4 -4) 📝 `proxmox/config_qemu_test.go` (+23 -23) 📝 `proxmox/util.go` (+9 -0) 📝 `proxmox/util_test.go` (+38 -0) </details> ### 📄 Description The proxmox ui removes trailing `0` and `.` from floating point numbers, while we do not. This results in settings in the config being visually different when created by the this library or the proxmox gui. Example: - gui: `mbps_rd=10.00` - library: `mbps_rd=10` This changes the formatting so the gui and library produce the same values. Work done: - Created `floatToTrimmedString()` - Added tests for `floatToTrimmedString()` - Updated existing unit test to account for the new number formatting (removed trailing zero) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:41:58 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#378
No description provided.