How to format number string with . net core?

Asked

Viewed 49 times

0

I need to format this number string, which is returned from an api:

inserir a descrição da imagem aqui

As I wish: 83,951,583.

Página Razor:

<h3>Mundo</h3>

<div class="card bg-primary text-white mb-3" style="max-width: 14rem;">
  <div class="card-body">
    <h5 class="card-text">Casos confirmados</h5>
    <h3>@Model.Global.TotalConfirmed</h3>
  </div>
</div>
  • You have tested any of these options> https://docs.microsoft.com/pt-br/dotnet/standard/base-types/standard-numeric-format-strings

  • I tried, but I could not implement in Razor page.

  • Hello Eduardo. Use [email protected]('{0:c}', <valor vai aqui>) with the parameter 'c', as explained in https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings?redirectedfrom=MSDN ... exchange the <valor vai aqui> value you want to pass from your Model.

  • I got it some other way. Thank you!

1 answer

1


Browser other questions tagged

You are not signed in. Login or sign up in order to post.