0
I am trying to convert the table data to the correct monetary value, and I am using the numeral.js, I have the following script
@section scripts{
<script src="~/Scripts/jquery.bootgrid.js"></script>
<script src="~/Scripts/numeral/numeral.min.js"></script>
@Scripts.Render("~/bundles/jquerybootgrid")
<script src="~/Scripts/Projeto/ControlarGrid.js"></script>
<script type="text/javascript">
numeral.language("pt-br");
var controller = "Produtos";
var urlListar = "@Url.Action("Listar")";
$(document).ready(configurarControles);
</script>
}
where I have a script folder ... and a language with the en to use as default, but when it starts the script an error occurs right in the numeral.language("pt-br")
taking into consideration that I am calling the file numeral.min.js
What error appears? Open the browser console and analyze the error there.
– Douglas Garrido
The following error occurs Failed to load Resource: the server responded with a status of 404 (Not Found) Products:315 Uncaught Typeerror: numeral.Languages is not a Function at Products:315 ... but this is provided by the ... number because if I take it out, it works normally
– Bruno Silva
Failed to load JS file from Numeral, hence variable
numeral
does not have the functionlanguage
. Make sure you are loading the right script on the page.– Douglas Garrido
Well when I go in source by browser, appears the folder numeral and inside is only appearing the numeral.min.js the other files are not being loaded and neither the language
– Bruno Silva
Where is the HTML reference of the "language" file? From what I understand, the function
language
is already from the file "numeral.min.js".– Douglas Garrido
But I have to also make a call to the language inside this html? so I can use the numeral.language?
– Bruno Silva
<script src="~/Scripts/numeral/Languages.min.js"></script> <script src="~/Scripts/numeral/Languages/en.js"></script> Should I also make these calls? and even if I do that the error continues to persist ...
– Bruno Silva
If you need to use "Languages.min.js", of course you have to import it into the HTML page. Now the function error
numeral.language
may be attached to these two scripts, so put the reference of the two on the page and test again.– Douglas Garrido