3838
3939namespace CodeIgniter \View ;
4040
41+ use Config \Services ;
42+ use NumberFormatter ;
43+
4144/**
4245 * View filters
4346 */
@@ -183,7 +186,7 @@ public static function highlight_code($value): string
183186 //--------------------------------------------------------------------
184187
185188 /**
186- * Limits the number of chracters to $limit, and trails of with an ellipsis.
189+ * Limits the number of characters to $limit, and trails of with an ellipsis.
187190 * Will break at word break so may be more or less than $limit.
188191 *
189192 * @param $value
@@ -232,13 +235,13 @@ public static function local_number($value, string $type = 'decimal', int $preci
232235 helper ('number ' );
233236
234237 $ types = [
235- 'decimal ' => \ NumberFormatter::DECIMAL ,
236- 'currency ' => \ NumberFormatter::CURRENCY ,
237- 'percent ' => \ NumberFormatter::PERCENT ,
238- 'scientific ' => \ NumberFormatter::SCIENTIFIC ,
239- 'spellout ' => \ NumberFormatter::SPELLOUT ,
240- 'ordinal ' => \ NumberFormatter::ORDINAL ,
241- 'duration ' => \ NumberFormatter::DURATION ,
238+ 'decimal ' => NumberFormatter::DECIMAL ,
239+ 'currency ' => NumberFormatter::CURRENCY ,
240+ 'percent ' => NumberFormatter::PERCENT ,
241+ 'scientific ' => NumberFormatter::SCIENTIFIC ,
242+ 'spellout ' => NumberFormatter::SPELLOUT ,
243+ 'ordinal ' => NumberFormatter::ORDINAL ,
244+ 'duration ' => NumberFormatter::DURATION ,
242245 ];
243246
244247 return format_number ($ value , $ precision , $ locale , ['type ' => $ types [$ type ]]);
@@ -260,7 +263,7 @@ public static function local_currency($value, string $currency, string $locale =
260263 helper ('number ' );
261264
262265 $ options = [
263- 'type ' => \ NumberFormatter::CURRENCY ,
266+ 'type ' => NumberFormatter::CURRENCY ,
264267 'currency ' => $ currency ,
265268 ];
266269
@@ -277,7 +280,7 @@ public static function local_currency($value, string $currency, string $locale =
277280 */
278281 public static function nl2br (string $ value ): string
279282 {
280- $ typography = \ Config \ Services::typography ();
283+ $ typography = Services::typography ();
281284
282285 return $ typography ->nl2brExceptPre ($ value );
283286 }
@@ -294,7 +297,7 @@ public static function nl2br(string $value): string
294297 */
295298 public static function prose (string $ value ): string
296299 {
297- $ typography = \ Config \ Services::typography ();
300+ $ typography = Services::typography ();
298301
299302 return $ typography ->autoTypography ($ value );
300303 }
@@ -309,12 +312,12 @@ public static function prose(string $value): string
309312 * - floor always rounds down
310313 *
311314 * @param string $value
312- * @param integer $precision
315+ * @param mixed $precision
313316 * @param string $type
314317 *
315318 * @return string
316319 */
317- public static function round ($ value , $ precision = 2 , $ type = 'common ' ): string
320+ public static function round (string $ value , $ precision = 2 , string $ type = 'common ' ): string
318321 {
319322 if (! is_numeric ($ precision ))
320323 {
0 commit comments