[GH-ISSUE #301] [BUG] Too many digits on Request / Response Body Size #297

Closed
opened 2026-03-03 19:17:13 +03:00 by kerem · 8 comments
Owner

Originally created by @NghiaTranUIT on GitHub (Oct 14, 2019).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/301

Originally assigned to: @NghiaTranUIT on GitHub.

🐶 Brief

In the latest version, they request and response body size have many redundant digits.

Screen Shot 2019-10-14 at 23 03 26

👑 Criteria

  • Should be round to 1 floating digit
Originally created by @NghiaTranUIT on GitHub (Oct 14, 2019). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/301 Originally assigned to: @NghiaTranUIT on GitHub. ## 🐶 Brief In the latest version, they request and response body size have many redundant digits. <img width="1496" alt="Screen Shot 2019-10-14 at 23 03 26" src="https://user-images.githubusercontent.com/5878421/66765817-e857f000-eed6-11e9-866a-5c281aa06e16.png"> ## 👑 Criteria - [ ] Should be round to 1 floating digit
kerem 2026-03-03 19:17:13 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@shirshak55 commented on GitHub (Oct 14, 2019):

haha this floating point digit is always pain in ass :) Specially in JS as it only has f64 it even gets more irritating.

<!-- gh-comment-id:541807521 --> @shirshak55 commented on GitHub (Oct 14, 2019): haha this floating point digit is always pain in ass :) Specially in JS as it only has f64 it even gets more irritating.
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 15, 2019):

In the past, I encountered this floating pain when parsing the number in JSON too (https://github.com/ProxymanApp/Proxyman/issues/169). It's weird that the JSONSerialization class in Foundation framework doesn't handle it properly and our developer have to fix it manually. 😅

<!-- gh-comment-id:542038581 --> @NghiaTranUIT commented on GitHub (Oct 15, 2019): In the past, I encountered this floating pain when parsing the number in JSON too (https://github.com/ProxymanApp/Proxyman/issues/169). It's weird that the JSONSerialization class in Foundation framework doesn't handle it properly and our developer have to fix it manually. 😅
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 18, 2019):

All done 🎉

Changelogs

  • Fix formatter.maximumFractionDigits in NSNumberFormatter
<!-- gh-comment-id:543459700 --> @NghiaTranUIT commented on GitHub (Oct 18, 2019): All done 🎉 ## Changelogs - Fix `formatter.maximumFractionDigits` in `NSNumberFormatter`
Author
Owner

@shirshak55 commented on GitHub (Oct 18, 2019):

@NghiaTranUIT what will happen if the data was actually 70.000000001?

<!-- gh-comment-id:543495665 --> @shirshak55 commented on GitHub (Oct 18, 2019): @NghiaTranUIT what will happen if the data was actually 70.000000001?
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 18, 2019):

We round it up to 70 (Bytes) 😄

<!-- gh-comment-id:543496185 --> @NghiaTranUIT commented on GitHub (Oct 18, 2019): We round it up to 70 (Bytes) 😄
Author
Owner

@shirshak55 commented on GitHub (Oct 18, 2019):

hmm i am that is problem right? Lets say I am working on money endpoint and supplied 70.00001 and proxyman made it 70 and i mock that response to test api server now it will fail because my api server consumer expects it to be 70.00001 not 70 . SO I think proxy man should serve same response given by server and should not roundup etc.

<!-- gh-comment-id:543504570 --> @shirshak55 commented on GitHub (Oct 18, 2019): hmm i am that is problem right? Lets say I am working on money endpoint and supplied 70.00001 and proxyman made it 70 and i mock that response to test api server now it will fail because my api server consumer expects it to be 70.00001 not 70 . SO I think proxy man should serve same response given by server and should not roundup etc.
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 18, 2019):

The size of the response remains as it is (70.00001) and your Test API server won't be failed. It only rounds up for the presenter on the flow panel.

If we need the precise value, I suppose that I would implement the Summary tab, which presents all essential data without round up.

<!-- gh-comment-id:543568367 --> @NghiaTranUIT commented on GitHub (Oct 18, 2019): The size of the response remains as it is (70.00001) and your Test API server won't be failed. It only rounds up for the presenter on the flow panel. If we need the precise value, I suppose that I would implement the Summary tab, which presents all essential data without round up.
Author
Owner

@shirshak55 commented on GitHub (Oct 18, 2019):

i mean if i save response to disk will it modify according to presenter or it will save response as it should?

<!-- gh-comment-id:543572133 --> @shirshak55 commented on GitHub (Oct 18, 2019): i mean if i save response to disk will it modify according to presenter or it will save response as it should?
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/Proxyman#297
No description provided.