Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Huge error of Postgresql! Double fields by transmission to the program lose a fractional part!
Re: Huge error of Postgresql! Double fields by transmission to the program lose a fractional part! [message #47535 is a reply to message #47534] Thu, 26 January 2017 01:25 Go to previous messageGo to previous message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Modified code (while lang settings SetLanguage(LNGFromText("RU-RU"));:
	char *s = PQgetvalue(result, fetched_row, i);
	switch(info[i].type)
	{
		case INT64_V:
			f.SetValue(ScanInt64(s));
			break;
		case INT_V:
			f.SetValue(atoi(s));
			break;
		case DOUBLE_V:
			RLOG("===start analysis===");
			RDUMP(s);
			double da,dS;
			da = atof(s);
			dS = ScanDouble(s);
			RDUMP(da);
			RDUMP(dS);
			static String test_format_and_lang_settings;
			test_format_and_lang_settings = Format("%f",dS);
			RDUMP(test_format_and_lang_settings);
			RLOG("====end analysis====");
			RLOG(" ");
			f.SetValue(ScanDouble(s));
			break;
		case BOOL_V:
			f.SetValue(*s == 't' ? "1" : "0");
			break;
		case DATE_V:



Log:
26.01.2017 03:22:15 ===start analysis===
26.01.2017 03:22:15 s = 90
26.01.2017 03:22:15 da = 90
26.01.2017 03:22:15 dS = 90
26.01.2017 03:22:15 test_format_and_lang_settings = 90,000000
26.01.2017 03:22:15 ====end analysis====
26.01.2017 03:22:15  
26.01.2017 03:22:15 ===start analysis===
26.01.2017 03:22:15 s = 40
26.01.2017 03:22:15 da = 40
26.01.2017 03:22:15 dS = 40
26.01.2017 03:22:15 test_format_and_lang_settings = 40,000000
26.01.2017 03:22:15 ====end analysis====
26.01.2017 03:22:15  
26.01.2017 03:22:15 ===start analysis===
26.01.2017 03:22:15 s = 269.96336996337
26.01.2017 03:22:15 da = 269
26.01.2017 03:22:15 dS = 269.96336996337
26.01.2017 03:22:15 test_format_and_lang_settings = 269,963370
26.01.2017 03:22:15 ====end analysis====
26.01.2017 03:22:15  
26.01.2017 03:22:15 ===start analysis===
26.01.2017 03:22:15 s = 381.556455240666
26.01.2017 03:22:15 da = 381
26.01.2017 03:22:15 dS = 381.556455240666
26.01.2017 03:22:15 test_format_and_lang_settings = 381,556455
26.01.2017 03:22:15 ====end analysis====
26.01.2017 03:22:15  
26.01.2017 03:22:15 ===start analysis===
26.01.2017 03:22:15 s = 282.083413662361
26.01.2017 03:22:15 da = 282
26.01.2017 03:22:15 dS = 282.083413662361
26.01.2017 03:22:15 test_format_and_lang_settings = 282,083414
26.01.2017 03:22:15 ====end analysis====


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Thu, 26 January 2017 01:28]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: I propose to Add Postgresql to topic header
Next Topic: How can .sch express a many-to-many relationship ?
Goto Forum:
  


Current Time: Sat May 11 20:32:52 CEST 2024

Total time taken to generate the page: 0.01667 seconds