Added new function

pull/77/head
parent 00baa7faf7
commit 8a7189c6bf

@ -35,6 +35,14 @@ float yon_size_convert_automatic(int bytes, int *size){
return byte_float; return byte_float;
} }
long yon_size_to_bytes(long size, int size_mod){
long final = size;
for (int i=0;i<size_mod;i++){
final=final*1024;
}
return final;
}
int yon_get_size_get_from_letter(char size){ int yon_get_size_get_from_letter(char size){
switch (size){ switch (size){
case 'K': return 0; case 'K': return 0;

@ -1054,15 +1054,18 @@ config_str yon_ubl_get_all_users(int *user_size);
int yon_password_get_min_len(); int yon_password_get_min_len();
/** yon_size_convert_automatic(int bytes, int *size) /// @brief Converts bytes amount to kilobytes, megabytes gigabytes or terabytes (K, M, G, T)
* [EN] /// @param bytes bytes to convert
* /// @param size pointer for conversion iteration number. use it with yon_size_get_mod() to get text string of conversion
* [RU] /// @return converted to kilobytes, megabytes gigabytes or terabytes vaue
* Делит число [bytes] на 1024 пока оно не станет меньше 1024.
* Возвращает получившееся число и устанавливает [size] равным количеству делений.
*/
float yon_size_convert_automatic(int bytes, int *size); float yon_size_convert_automatic(int bytes, int *size);
/// @brief Convert size from kilobytes, megabytes gigabytes or terabytes (K, M, G, T) to bytes
/// @param size initial size to convert
/// @param size_mod size modifier. Use yon_get_size_get_from_letter() to get.
/// @return converted to bytes value
long yon_size_to_bytes(long size, int size_mod);
/**yon_get_size_get_from_letter(char size) /**yon_get_size_get_from_letter(char size)
* [EN] * [EN]
* *

Loading…
Cancel
Save