mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	Tweak duration_to_string formatting
This commit is contained in:
		@@ -670,15 +670,19 @@ inline const std::string duration_to_string(int sec)
 | 
			
		||||
 | 
			
		||||
	std::stringstream ss;
 | 
			
		||||
	if (hour > 0) {
 | 
			
		||||
		ss << hour << "h ";
 | 
			
		||||
		ss << hour << "h";
 | 
			
		||||
		if (min > 0 || sec > 0)
 | 
			
		||||
			ss << " ";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (min > 0) {
 | 
			
		||||
		ss << min << "m ";
 | 
			
		||||
		ss << min << "min";
 | 
			
		||||
		if (sec > 0)
 | 
			
		||||
			ss << " ";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (sec > 0) {
 | 
			
		||||
		ss << sec << "s ";
 | 
			
		||||
		ss << sec << "s";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return ss.str();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user