Skip to content

Commit

Permalink
Update README and remove NaN usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Deadpikle committed Feb 6, 2019
1 parent 8aba2d1 commit 3241c14
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions EasyBackup/Models/FolderFileCopyProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,20 @@ public string UserReadableBytesToCopy

public double Progress
{
get { return (double)BytesCopied / (double)TotalBytesToCopy * 100; }
get
{
if (TotalBytesToCopy == 0)
{
return 0;
}
return (double)BytesCopied / (double)TotalBytesToCopy * 100;
}
}

public string ProgressString
{
get
{
if (double.IsNaN(Progress))
{
return "0.00";
}
return string.Format("{0:N2}", Progress);
}
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Features include:
* The most recently used backup template file is automatically loaded for you when starting the software. A backup is only a few clicks away!
* If copying a directory non-recursively, choose to only copy the last modified file in that directory. This could be useful when backing up a directory that contains local file backups, for example -- you may not need all the local backups, just the latest one.
* View backup progress as it happens
* Optional sounds when backup succeeds or fails
* Cancel backup at any time

## Screenshots
Expand Down

0 comments on commit 3241c14

Please sign in to comment.