Merge remote-tracking branch 'origin/devel' into devel

This commit is contained in:
Serge Rider
2021-03-22 16:18:02 +03:00
2 changed files with 26 additions and 0 deletions
@@ -0,0 +1,25 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2021 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
export function declensionOfNumber(value: number, words: string[]) {
value = Math.abs(value) % 100;
const num = value % 10;
if (value > 10 && value < 20) {
return words[2];
}
if (num > 1 && num < 5) {
return words[1];
}
if (num === 1) {
return words[0];
}
return words[2];
}
+1
View File
@@ -7,6 +7,7 @@ export * from './generateFileName';
export * from './md5';
export * from './TextTools';
export * from './copyToClipboard';
export * from './declensionOfNumber';
export * from './Promises/CancellablePromise';
export * from './Promises/Deferred';