wc_let_to_num( string $size )
Notation to numbers.
Description Description
This function transforms the php.ini notation for numbers (like ‘2M’) to an integer.
Parameters Parameters
- $size
-
(Required) Size value.
Return Return
(int)
Source Source
File: includes/wc-formatting-functions.php
function wc_let_to_num( $size ) { $l = substr( $size, -1 ); $ret = (int) substr( $size, 0, -1 ); switch ( strtoupper( $l ) ) { case 'P': $ret *= 1024; // No break. case 'T': $ret *= 1024; // No break. case 'G': $ret *= 1024; // No break. case 'M': $ret *= 1024; // No break. case 'K': $ret *= 1024; // No break. } return $ret; }