Automattic\WooCommerce\Internal\Admin\Settings
SettingsUISchema::unsigned_decimal_is_greater
Compare normalized unsigned decimal strings.
Method of the class: SettingsUISchema{}
No Hooks.
Returns
bool.
Usage
$result = SettingsUISchema::unsigned_decimal_is_greater( $left, $right ): bool;
- $left(string) (required)
- Left operand.
- $right(string) (required)
- Right operand.
SettingsUISchema::unsigned_decimal_is_greater() SettingsUISchema::unsigned decimal is greater code WC 11.2.1
private static function unsigned_decimal_is_greater( string $left, string $right ): bool {
$left = ltrim( $left, '0' );
$right = ltrim( $right, '0' );
$left = '' === $left ? '0' : $left;
$right = '' === $right ? '0' : $right;
return strlen( $left ) !== strlen( $right ) ? strlen( $left ) > strlen( $right ) : 0 < strcmp( $left, $right );
}