小编max*_*c00的帖子

intl.NumberFormat 显示 es-ES 货币格式不正确的结果

我希望 es-ES 和 de-DE 语言环境的输出相同。(我让我的西班牙同事检查他的工资单,他确认千位后确实有一个小数)

var number = 1000;
console.log(new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(number));
console.log(new Intl.NumberFormat('es-ES', { style: 'currency', currency: 'EUR' }).format(number));
Run Code Online (Sandbox Code Playgroud)

结果:

> "1.000,00 €"
> "1000,00 €"
Run Code Online (Sandbox Code Playgroud)

javascript internationalization

7
推荐指数
1
解决办法
1548
查看次数

express.static处理根URL请求

express.static正在处理根URL请求.例如,我想从https://example.comhttps://example.com/dashboard进行快速重定向.检查下面的情况,第一个工作,第二个不工作.我希望第二个也能奏效.谁知道为什么?

案例1(工程)

app.get('/', (req, res, next) => {
   res.redirect('/dashboard');
})    

app.use(express.static(path.join(__dirname, 'dist')))

app.get('/dashboard', (req, res, next) => {
   //do stuff
}) 
Run Code Online (Sandbox Code Playgroud)

案例2(对我不起作用)

app.use(express.static(path.join(__dirname, 'dist')))

//request doesn't come here 
app.get('/', (req, res, next) => {   
   res.redirect('/dashboard')
})

app.get('/dashboard', (req, res, next) => {
  //do some stuff
}) 
Run Code Online (Sandbox Code Playgroud)

node.js express

5
推荐指数
1
解决办法
1571
查看次数