File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -205,8 +205,22 @@ def short_numeric_filter(
205
205
) # print abbreviated output
206
206
207
207
208
- # add filter to Jinja
209
- app .jinja_env .filters ["short_numeric" ] = short_numeric_filter
208
+ app .jinja_env .filters ["short_numeric" ] = (
209
+ short_numeric_filter # add short numeric filter to Jinja
210
+ )
211
+
212
+
213
+ # round number with commas filter
214
+ @app .template_filter ("round_number_with_commas" )
215
+ def round_number_with_commas_filter (
216
+ value : Union [int , float ]
217
+ ) -> str : # round number with commas
218
+ return f"{ round (value ):,} "
219
+
220
+
221
+ app .jinja_env .filters ["round_number_with_commas" ] = (
222
+ round_number_with_commas_filter # add round number with commas filter to Jinja
223
+ )
210
224
211
225
212
226
@app .route ("/" )
You can’t perform that action at this time.
0 commit comments