#PCBBAY0000021. Dấu phân cách hàng nghìn cho số thực (Thousands Separators for Floats)
Dấu phân cách hàng nghìn cho số thực (Thousands Separators for Floats)
Thousands Separators for Floats
Version: Phuoc Hung OJ Extended
Problem Statement
Given a real number , print it in fixed-point notation with exactly 2 decimal places. Separate groups of three digits in the integer part using commas, counting from the right, and preserve the negative sign if present. This matches Python 3 ,.2f formatting.
Input
The only line contains a real number .
Output
Print with thousands separators and exactly 2 decimal places.
Subtasks
- Subtask 1 (100 points): .
Examples
Example 1
Input
1234567.8
Output
1,234,567.80
Explanation. For input 1234567.8, applying ,.2f formatting produces exactly 1,234,567.80 (including any trailing zeros, separators or exponent characters).
Example 2
Input
12.0
Output
12.00
Explanation. For input 12.0, applying ,.2f formatting produces exactly 12.00 (including any trailing zeros, separators or exponent characters).
Example 3
Input
-98765.432
Output
-98,765.43
Explanation. For input -98765.432, applying ,.2f formatting produces exactly -98,765.43 (including any trailing zeros, separators or exponent characters).