简体   繁体   中英

Consitent date, numbers formatting across C# (backend) and JS (front end)

I am writing a system which shows customer data in front-end, but also allows exporting data via back-end to various file formats. I am using globalize.js and .NET's native Globalization capabilities, but for some languages I am getting differences in date format (eg. "31.1.2016" vs. "31-01-2016") and number format (eg. "1.234,56" vs "1 234,56"). Does anybody have any suggestion how can format dates and numbers across back-end and front-end and still get consistent results?

I can't pre-format values to string and pass strings to the front-end, because some front-end components (like charts) expect raw integers, dates to to be able to render the data properly.

您可以同时从后端传递两个内容:数字日期和字符串表示形式。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM