mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Fixed conversion of floating point values to string from PlaceholderParser
after boost::to_string() was removed from boost 1.66.
This commit is contained in:
		
							parent
							
								
									b6f2f00ea4
								
							
						
					
					
						commit
						13f0da3ace
					
				
					 1 changed files with 15 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -270,9 +270,22 @@ namespace client
 | 
			
		|||
        {
 | 
			
		||||
            std::string out;
 | 
			
		||||
            switch (type) {
 | 
			
		||||
            case TYPE_BOOL:   out = std::to_string(data.b); break;
 | 
			
		||||
			case TYPE_BOOL:   out = data.b ? "true" : "false"; break;
 | 
			
		||||
            case TYPE_INT:    out = std::to_string(data.i); break;
 | 
			
		||||
            case TYPE_DOUBLE: out = std::to_string(data.d); break;
 | 
			
		||||
            case TYPE_DOUBLE: 
 | 
			
		||||
#if 0
 | 
			
		||||
                // The default converter produces trailing zeros after the decimal point.
 | 
			
		||||
				out = std::to_string(data.d);
 | 
			
		||||
#else
 | 
			
		||||
                // ostringstream default converter produces no trailing zeros after the decimal point.
 | 
			
		||||
                // It seems to be doing what the old boost::to_string() did.
 | 
			
		||||
				{
 | 
			
		||||
					std::ostringstream ss;
 | 
			
		||||
					ss << data.d;
 | 
			
		||||
					out = ss.str();
 | 
			
		||||
				}
 | 
			
		||||
#endif
 | 
			
		||||
				break;
 | 
			
		||||
            case TYPE_STRING: out = *data.s; break;
 | 
			
		||||
            default:          break;
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue