williamjda Posted April 2, 2015 at 07:24 PM Report Share #580750 Posted April 2, 2015 at 07:24 PM (edited) Amigos tenho uma questão. Estou a dividir um campo onde o valor é em real por uma certa quantidade. EXEMPLO: 15,97 / 7 = 2,28142857142857 Porem gostaria que o resultado aparecesse desta forma; 2,28 Se eu divido 50,00 / 1 = 50 Porem gostaria que o resultado aparecesse desta forma; 50,00 Sempre conservando duas casas decimais depois da virgula. Private Function GetValueVirgula(Value As String) As Decimal Value = Value.Replace(",", Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator) Return Decimal.Parse(Value) End Function txtvalorUnitarioComponente.Text = GetValueVirgula(txtvalorTotalUnidadeFechada.Text) / Val(txtqtdUnidadeFechadaAdquerida.Text) Como posso corrigir essa questão? Edited April 3, 2015 at 02:50 AM by williamjda Link to comment Share on other sites More sharing options...
vikcch Posted April 6, 2015 at 06:42 PM Report Share #580865 Posted April 6, 2015 at 06:42 PM link Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now