-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adicionadas e tratadas urls para NFce das seguintes SEFAZes: SVRS, AM…
…, MT, PR, RS e SP; Substituídas as urls da SEFAZ RS, conforme nota divulgada em 08/04/2015; Correção no arredondamento de valores: Não estava gravando os campos do tipo decimal? com todas as casas decimais definidas na função Valor.Arredondar; Adicionado, na tela do aplicativo de demonstração, guia "Geral", opção para escolha do tipo de documento (NFe ou NFCe).
- Loading branch information
1 parent
93152f2
commit c7705a8
Showing
13 changed files
with
1,524 additions
and
848 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
using System; | ||
using System.Globalization; | ||
|
||
namespace NFe.Classes | ||
{ | ||
public static class Valor | ||
{ | ||
public static decimal Arredondar(decimal valor, int casasDecimais) | ||
{ | ||
return Decimal.Round(valor, casasDecimais); | ||
var valorNovo = Decimal.Round(valor, casasDecimais); | ||
var valorNovoStr = valorNovo.ToString("F" + casasDecimais, CultureInfo.CurrentCulture); | ||
return Decimal.Parse(valorNovoStr); | ||
} | ||
|
||
public static decimal? Arredondar(decimal? valor, int casasDecimais) | ||
{ | ||
return valor.HasValue ? decimal.Round(valor.Value, casasDecimais) : (decimal?) null; | ||
if (valor == null) return null; | ||
return Arredondar(valor.Value, casasDecimais); | ||
} | ||
} | ||
} |
Oops, something went wrong.