@@ -1189,22 +1189,18 @@ def test_display_subset(self):
1189
1189
{"a" : "{:0.1f}" , "b" : "{0:.2%}" }, subset = pd .IndexSlice [0 , :]
1190
1190
)._translate ()
1191
1191
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"
1198
1193
assert ctx ["body" ][0 ][1 ]["display_value" ] == expected
1199
1194
assert ctx ["body" ][1 ][1 ]["display_value" ] == raw_11
1200
-
1195
+ assert ctx ["body" ][0 ][2 ]["display_value" ] == "12.34%"
1196
+
1201
1197
ctx = df .style .format ("{:0.1f}" , subset = pd .IndexSlice [0 , :])._translate ()
1202
1198
assert ctx ["body" ][0 ][1 ]["display_value" ] == expected
1203
1199
assert ctx ["body" ][1 ][1 ]["display_value" ] == raw_11
1204
1200
1205
1201
ctx = df .style .format ("{:0.1f}" , subset = pd .IndexSlice ["a" ])._translate ()
1206
1202
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 "
1208
1204
1209
1205
ctx = df .style .format ("{:0.1f}" , subset = pd .IndexSlice [0 , "a" ])._translate ()
1210
1206
assert ctx ["body" ][0 ][1 ]["display_value" ] == expected
@@ -1215,8 +1211,8 @@ def test_display_subset(self):
1215
1211
)._translate ()
1216
1212
assert ctx ["body" ][0 ][1 ]["display_value" ] == expected
1217
1213
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
1220
1216
1221
1217
def test_display_dict (self ):
1222
1218
df = pd .DataFrame ([[0.1234 , 0.1234 ], [1.1234 , 1.1234 ]], columns = ["a" , "b" ])
0 commit comments