-
Notifications
You must be signed in to change notification settings - Fork 258
Source code
Ken Kousen edited this page Oct 7, 2018
·
4 revisions
MyBean.java
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import java.text.NumberFormat;
import java.util.Locale;
@Configuration
public class MyBeans {
@Bean
public NumberFormat defaultCurrencyFormatter() {
return NumberFormat.getCurrencyInstance();
}
@Bean @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public NumberFormat deCurrencyFormatter() {
return NumberFormat.getCurrencyInstance(Locale.GERMANY);
}
}