mirror of
https://github.com/iv-org/invidious.git
synced 2024-10-01 01:25:56 -04:00
Change regex used in short_text_to_number
This commit is contained in:
parent
85dd3533bb
commit
0d3610f63d
@ -162,7 +162,7 @@ def number_with_separator(number)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def short_text_to_number(short_text : String) : Int64
|
def short_text_to_number(short_text : String) : Int64
|
||||||
matches = /(?<number>\d+(\.\d+)?)\s?(?<suffix>[mMkKbB]|())?/.match(short_text)
|
matches = /(?<number>\d+(\.\d+)?)\s?(?<suffix>[mMkKbB]?)/.match(short_text)
|
||||||
number = matches.try &.["number"].to_f || 0.0
|
number = matches.try &.["number"].to_f || 0.0
|
||||||
|
|
||||||
case matches.try &.["suffix"].downcase
|
case matches.try &.["suffix"].downcase
|
||||||
|
Loading…
Reference in New Issue
Block a user