mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-09-23 10:22:54 +00:00
Merge "Make lang:parseFormattedNumber more like tonumber"
This commit is contained in:
commit
0f45f9e5cb
|
@ -113,7 +113,10 @@ class Scribunto_LuaLanguageLibrary extends Scribunto_LuaLibraryBase {
|
|||
if ( is_numeric( $args[0] ) ) {
|
||||
$args[0] = strval( $args[0] );
|
||||
}
|
||||
$this->checkType( $name, 1, $args[0], 'string' );
|
||||
if ( $this->getLuaType( $args[0] ) !== 'string' ) {
|
||||
// Be like tonumber(), return nil instead of erroring out
|
||||
return array( null );
|
||||
}
|
||||
return array( $lang->$name( $args[0] ) );
|
||||
|
||||
// Custom handling
|
||||
|
|
Loading…
Reference in a new issue