recibir la imagen en la api corectamente
This commit is contained in:
13
apps/web/feactures/inventory/utils/sizeFormate.ts
Normal file
13
apps/web/feactures/inventory/utils/sizeFormate.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export const sizeFormate = (size: number) => {
|
||||
let tamañoFormateado = '';
|
||||
if (size < 1024) {
|
||||
tamañoFormateado = size + ' bytes';
|
||||
} else if (size < 1024 * 1024) {
|
||||
tamañoFormateado = (size / 1024).toFixed(2) + ' KB';
|
||||
} else if (size < 1024 * 1024 * 1024) {
|
||||
tamañoFormateado = (size / (1024 * 1024)).toFixed(2) + ' MB';
|
||||
} else {
|
||||
tamañoFormateado = (size / (1024 * 1024 * 1024)).toFixed(2) + ' GB';
|
||||
}
|
||||
return tamañoFormateado;
|
||||
}
|
||||
Reference in New Issue
Block a user