Skip to content

Commit 2d3b824

Browse files
Forma de calculo corrigida para representação de valores reais
1 parent be53e6e commit 2d3b824

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Sistema/MemoriaRam.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function __construct(Conector $conexao)
4848
/**
4949
* Retorna o total de memória física livre e o percentual que este total representa
5050
*
51+
* @param boolean $emBytes
5152
* @return array
5253
*/
5354
public function memoriaLivre($emBytes = false)
@@ -58,7 +59,7 @@ public function memoriaLivre($emBytes = false)
5859

5960
return [
6061
'livre' => $livre,
61-
'percentualLivre' => sprintf("%0.2f%%", (100 * $livre / $this->memoriaTotal()))
62+
'percentualLivre' => sprintf("%0.2f%%", (100 * $livre / $this->memoriaTotal($emBytes)))
6263
];
6364
}
6465

@@ -81,6 +82,7 @@ public function memoriaUtilizada()
8182
/**
8283
* Retorna o total de memória física
8384
*
85+
* @param boolean $emBytes
8486
* @return string
8587
*/
8688
public function memoriaTotal($emBytes = false)

0 commit comments

Comments
 (0)