Re: [Cppcms-users] How to set default response().out() stream precision?
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-06-21 10:03:09
|
See changing defaults is very bad idea - especially at framework level. If you have some trouble in all over the code, that seems that you had some **design** problem at the beginning and you try to solve it by altering the framework itself. The correct way to solve it is to set the precision on template level where you need: <% gt "{1,precision =10}" using my_high_precision_value %> See: http://www.boost.org/doc/libs/1_49_0/libs/locale/doc/html/localized_text_formatting.html If you need to change it globally create a small function in you topmost application class that all your classes are derived from: void render(std::string const &template_name,cppcms::basi_context &c) { response().out() << std::setprecision(10); cppcms::application::render(template_name,c); } Or even better create render_with_high_precision(...) function and do small refactoring. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ----- Original Message ----- > From: "ele...@ex..." <ele...@ex...> > To: Artyom Beilis <art...@ya...>; cpp...@li... > Cc: > Sent: Thursday, June 21, 2012 12:51 PM > Subject: Re: [Cppcms-users] How to set default response().out() stream precision? > > Can you at least increase the default precision of the stream to lets > say... 10? That would save me troubles having to patch cppcms on every > deployment of this app. > > It makes more sense than 6 which is in my opinion too low for just about > anything but the most basic applications. > > Cheers > Petr > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |