@@ -1189,22 +1189,18 @@ def test_display_subset(self):
11891189 {"a" : "{:0.1f}" , "b" : "{0:.2%}" }, subset = pd .IndexSlice [0 , :]
11901190 )._translate ()
11911191 expected = "0.1"
1192- assert ctx ["body" ][0 ][1 ]["display_value" ] == expected
1193- assert ctx ["body" ][1 ][1 ]["display_value" ] == "1.1234"
1194- assert ctx ["body" ][0 ][2 ]["display_value" ] == "12.34%"
1195-
1196- raw_11 = "1.1234"
1197- ctx = df .style .format ("{:0.1f}" , subset = pd .IndexSlice [0 , :])._translate ()
1192+ raw_11 = "1.123400"
11981193 assert ctx ["body" ][0 ][1 ]["display_value" ] == expected
11991194 assert ctx ["body" ][1 ][1 ]["display_value" ] == raw_11
1200-
1195+ assert ctx ["body" ][0 ][2 ]["display_value" ] == "12.34%"
1196+
12011197 ctx = df .style .format ("{:0.1f}" , subset = pd .IndexSlice [0 , :])._translate ()
12021198 assert ctx ["body" ][0 ][1 ]["display_value" ] == expected
12031199 assert ctx ["body" ][1 ][1 ]["display_value" ] == raw_11
12041200
12051201 ctx = df .style .format ("{:0.1f}" , subset = pd .IndexSlice ["a" ])._translate ()
12061202 assert ctx ["body" ][0 ][1 ]["display_value" ] == expected
1207- assert ctx ["body" ][0 ][2 ]["display_value" ] == "0.1234 "
1203+ assert ctx ["body" ][0 ][2 ]["display_value" ] == "0.123400 "
12081204
12091205 ctx = df .style .format ("{:0.1f}" , subset = pd .IndexSlice [0 , "a" ])._translate ()
12101206 assert ctx ["body" ][0 ][1 ]["display_value" ] == expected
@@ -1215,8 +1211,8 @@ def test_display_subset(self):
12151211 )._translate ()
12161212 assert ctx ["body" ][0 ][1 ]["display_value" ] == expected
12171213 assert ctx ["body" ][1 ][1 ]["display_value" ] == "1.1"
1218- assert ctx ["body" ][0 ][2 ]["display_value" ] == "0.1234 "
1219- assert ctx ["body" ][1 ][2 ]["display_value" ] == "1.1234"
1214+ assert ctx ["body" ][0 ][2 ]["display_value" ] == "0.123400 "
1215+ assert ctx ["body" ][1 ][2 ]["display_value" ] == raw_11
12201216
12211217 def test_display_dict (self ):
12221218 df = pd .DataFrame ([[0.1234 , 0.1234 ], [1.1234 , 1.1234 ]], columns = ["a" , "b" ])
0 commit comments