<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Regex] Rounding numbers python script does not run properly]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">unfortunately i can’t comment on the thread <a href="https://notepad-plus-plus.org/community/topic/15100/regex-rounding-numbers" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/15100/regex-rounding-numbers</a> , so i’m asking my question here.</p>
<p dir="auto">First of all I want to thank <a href="https://notepad-plus-plus.org/community/user/https://notepad-plus-plus.org/community/user/peterjones" rel="nofollow ugc">@PeterJones</a> for the nice Python script for rounding numbers in Notepad++.</p>
<p dir="auto">However, the script does not run correctly for unknown reasons. The following series of numbers (coordinates):</p>
<p dir="auto">5494577.00001803319901228 5650290.99997399840503931, 5494577.00001803319901228 5650288.99997399933636189, 5494575.00001802947372198 5650288.99997399933636189, 5494575.00001802947372198 5650286.99997399840503931, 5494573.00001803319901228 5650286.99997399840503931</p>
<p dir="auto">is converted to:</p>
<p dir="auto">5494577.0000 5650290.99997399840503931, 5494577.0000 5650288.99997399933636189, 5494575.0000 5650288.99997399933636189, 5494575.0000 5650286.99997399840503931, 5494573.0000 5650286.99997399840503931</p>
<p dir="auto">Unfortunately I could not fix the error in the script. What is exactly the problem?</p>
<p dir="auto">Thank you in advance!</p>
<p dir="auto">Sincerly,</p>
<p dir="auto">Stephan</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18133/regex-rounding-numbers-python-script-does-not-run-properly</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 10:22:09 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18133.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 Aug 2019 07:14:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Tue, 27 Aug 2019 19:12:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a></p>
<p dir="auto">No, I’m not trying to “parallel” the text in the real editor and the hidden.  If I set as the hidden editor’s entire text the match from the search, doing the replace on that guarantees the replace will succeed and the entire text left in the hidden editor’s buffer will be the replacement preview text.  Long to explain but it seems to work.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46649</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46649</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 27 Aug 2019 19:12:16 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Tue, 27 Aug 2019 19:02:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<blockquote>
<p dir="auto">and never do a “destroy”</p>
</blockquote>
<p dir="auto">:-D never ever - don’t even THINK about it unless your npp version is &gt; 7.7.1 :-D</p>
<blockquote>
<p dir="auto">The hidden instance’s entire text can be set to the matched text from the editor.research(). Then the hidden.rereplace() can b</p>
</blockquote>
<p dir="auto">I guess, hidden.rereplace() is enough if you keep the text from editor and hidden in sync.<br />
The replace function gets a match object which contains the position of the text to be replaced so from the replace function you could start the dialog, or?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46647</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46647</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 27 Aug 2019 19:02:41 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Tue, 27 Aug 2019 18:57:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> said:</p>
<blockquote>
<p dir="auto">I will do this near the top of the script, and never do a “destroy”:</p>
</blockquote>
<blockquote>
<p dir="auto">and never do a “destroy”</p>
</blockquote>
<p dir="auto">There really is an “echo” in here, or just me repeating myself and not noticing.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46646</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46646</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 27 Aug 2019 18:57:17 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Tue, 27 Aug 2019 14:13:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said:</p>
<blockquote>
<p dir="auto">what about using a hidden scintilla instance?</p>
</blockquote>
<p dir="auto">So, like this:  <code>hidden = notepad.createScintilla()</code></p>
<p dir="auto">That is actually a nice solution.  The hidden instance’s entire text can be set to the matched text from the <code>editor.research()</code>.  Then the <code>hidden.rereplace()</code> can be called and the result of the replacement read out into a Python string variable. Thanks, Eko; clearly I would not have thought of this technique without your pointer.</p>
<blockquote>
<p dir="auto">just be careful about notepad.destroyScintilla()</p>
</blockquote>
<p dir="auto">This is not a problem as I will do this near the top of the script, and never do a “destroy”:</p>
<pre><code>try:
    hidden
except NameError:
    hidden = notepad.createScintilla()
</code></pre>
<p dir="auto">and never do a “destroy”</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46643</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46643</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 27 Aug 2019 14:13:27 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Mon, 26 Aug 2019 20:11:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<p dir="auto">correct, that is the one.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46629</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46629</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 26 Aug 2019 20:11:41 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Mon, 26 Aug 2019 20:07:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a></p>
<p dir="auto">This is the issue, I assume:  <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4487" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4487</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/46628</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46628</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 26 Aug 2019 20:07:36 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Mon, 26 Aug 2019 19:23:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<p dir="auto">just be careful about <code>notepad.destroyScintilla(self.hidden_scintilla)</code><br />
Currently npp crashes when using this and then request another buffer.<br />
There is already a merged fix but only available on next release.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46627</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46627</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 26 Aug 2019 19:23:25 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Mon, 26 Aug 2019 19:18:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<p dir="auto">I used it <a href="https://notepad-plus-plus.org/community/topic/17631/assign-language-by-line" rel="nofollow ugc">here</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46626</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46626</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 26 Aug 2019 19:18:19 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Mon, 26 Aug 2019 19:13:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said:</p>
<blockquote>
<p dir="auto">what about using a hidden scintilla instance?</p>
</blockquote>
<p dir="auto">That also sounds “messy” (or “involved”) but if you have some snippet to show me it is not so bad…?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46624</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46624</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 26 Aug 2019 19:13:37 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Mon, 26 Aug 2019 19:10:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<p dir="auto">what about using a hidden scintilla instance?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46622</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46622</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 26 Aug 2019 19:10:16 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Mon, 26 Aug 2019 19:08:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said:</p>
<blockquote>
<p dir="auto">did I misunderstood your goal?</p>
</blockquote>
<p dir="auto">Maybe that part. :)</p>
<p dir="auto">To be able to offer a preview of the yet-to-be-done replacement, I need to know what that replacement will be.  I can’t do that without actually doing the replacement.  Catch-22.  I could do it and then undo it, I suppose, but that gets messy.  Mostly it should be OK, but sometimes with regexes Boost can differ from Python’s re.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46621</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46621</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 26 Aug 2019 19:08:34 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Mon, 26 Aug 2019 19:02:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<p dir="auto">one idea might be to search for matches and replace only those which are<br />
in the same range as the selected text. Something like</p>
<pre><code>if start_pos_selected text &lt;= match_start and end_pos_selected_text &gt;= match_end:
    replaceSelText
</code></pre>
<p dir="auto">Or did I misunderstood your goal? :-(</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46619</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46619</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 26 Aug 2019 19:02:47 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Mon, 26 Aug 2019 18:23:34 GMT]]></title><description><![CDATA[<p dir="auto">Ugh.  Clearly I meant this Pythonscript issue:  <a href="https://github.com/bruderstein/PythonScript/issues/101" rel="nofollow ugc">https://github.com/bruderstein/PythonScript/issues/101</a> in the previous post, but it is too late for an edit.  :(</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46606</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46606</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 26 Aug 2019 18:23:34 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Mon, 26 Aug 2019 18:06:30 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">Would you also publish your code for the interactive replace?</p>
</blockquote>
<blockquote>
<p dir="auto">I’m still working on a generic version; may never finish it</p>
</blockquote>
<p dir="auto">Follow-up:</p>
<p dir="auto">There may not be a reasonable way to script this (the “generic version”); here’s why:  There doesn’t seem to be a way to do a “boost-ish” replacement option on a Python string.  It’s only possible to do it on in-place text.</p>
<p dir="auto">What I want to do in the code is pull a copy of the matched text into a Python string and then do a Notepad++ -like replacement operation on that.  Sure I can do a Python “re” replacement on it, but that isn’t always going to be equivalent.</p>
<p dir="auto">Digging deeper, I see there is an open issue on this kind of thing in the Pythonscript code pages, <a href="https://github.com/bruderstein/PythonScript/issues/106" rel="nofollow ugc">here</a>.  But it hasn’t been acted on so it isn’t a reality.</p>
<p dir="auto">If anyone has thoughts on this, I’m all ears.  <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a>  ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46603</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46603</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 26 Aug 2019 18:06:30 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Sat, 24 Aug 2019 23:57:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a></p>
<p dir="auto">Well, Pythonscript sizes the dialog box according to contents, so I was trying to keep it as narrow and short as possible to avoid covering too much of the Notepad++ main window.  But…I’ve already added more info to make it taller, so why not wider as well? :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46560</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46560</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 24 Aug 2019 23:57:41 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Sat, 24 Aug 2019 22:51:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> said:</p>
<blockquote>
<p dir="auto"><code>Replace selected text with? :</code></p>
</blockquote>
<p dir="auto">Maybe <code>Would you like to replace the selected text with the following text?</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/46558</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46558</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 24 Aug 2019 22:51:51 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Sat, 24 Aug 2019 12:36:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/16216">@unfassbarstephan</a> said:</p>
<blockquote>
<p dir="auto">Would you also publish your code for the interactive replace?</p>
</blockquote>
<p dir="auto">I did…for your specific case.  I’m still working on a generic version; may never finish it… :(</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said:</p>
<blockquote>
<p dir="auto">Alan’s wasteful use of the question mark</p>
</blockquote>
<p dir="auto">Wasteful?  It doesn’t seem right without it; I did consider it this way as well, maybe better?:</p>
<p dir="auto"><code>Replace selected text with? :</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/46546</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46546</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 24 Aug 2019 12:36:22 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Sat, 24 Aug 2019 12:31:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/16216">@unfassbarstephan</a></p>
<blockquote>
<p dir="auto">Short question: What does “???” mean?</p>
</blockquote>
<p dir="auto">This is Alan’s wasteful use of the question mark,<br />
for which it is also used here, to ask a question. :-D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46545</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46545</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Sat, 24 Aug 2019 12:31:41 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Sat, 24 Aug 2019 10:11:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> said:</p>
<blockquote>
<p dir="auto">…still having fun with this…so much can be done to make interactive replace much better than what N++ can do; sample:</p>
</blockquote>
<p dir="auto">The one-line-solution works like a charm.</p>
<p dir="auto">Would you also publish your code for the interactive replace? That would be great.</p>
<p dir="auto">Short question: What does “???” mean?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46543</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46543</guid><dc:creator><![CDATA[unfassbarstephan]]></dc:creator><pubDate>Sat, 24 Aug 2019 10:11:23 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Fri, 23 Aug 2019 21:21:09 GMT]]></title><description><![CDATA[<p dir="auto">Wow, thank you dir your help! I will try this approach.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46538</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46538</guid><dc:creator><![CDATA[unfassbarstephan]]></dc:creator><pubDate>Fri, 23 Aug 2019 21:21:09 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Fri, 23 Aug 2019 18:04:30 GMT]]></title><description><![CDATA[<p dir="auto">…still having fun with this…so much can be done to make interactive replace much better than what N++ can do; sample:</p>
<p dir="auto"><img src="https://camo.nodebb.org/dbf2c5772b12c6528ded31f49777de1ae160ccde?url=https%3A%2F%2Fi.imgur.com%2FO7laXbv.png" alt="Imgur" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/46531</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46531</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 23 Aug 2019 18:04:30 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Fri, 23 Aug 2019 15:10:31 GMT]]></title><description><![CDATA[<p dir="auto">Just for fun (I say that a lot), here’s a version that does a <em>prompted</em> replace <em>with preview</em> (wouldn’t it be great if N++ itself offered a preview to its [regex] replacement?).  Strange but I’ve never coded this kind of thing before for N++; one more thing to stash in the bag-of-tricks…</p>
<pre><code>def main():

    while True:
        match_list = []
        editor.research("-*\d+\.\d{4,}", lambda m: match_list.append(m.span(0)), 0, editor.getCurrentPos(), editor.getTextLength(), 1)
        if len(match_list) == 0: return
        editor.setSelection(match_list[0][1], match_list[0][0]); editor.scrollCaret()
        repl_text = '{:0.3f}'.format(round(float(editor.getSelText()), 3))
        result = notepad.messageBox('Replace selected text with\r\n\r\n{}\r\n\r\n???'.format(repl_text), '', MESSAGEBOXFLAGS.YESNOCANCEL)
        if result == MESSAGEBOXFLAGS.RESULTCANCEL: return
        if result == MESSAGEBOXFLAGS.RESULTYES: editor.replaceSel(repl_text)

main()
</code></pre>
<p dir="auto"><img src="https://camo.nodebb.org/74640a93bce68644ce6a515558e43fd28c5fa186?url=https%3A%2F%2Fi.imgur.com%2FAjKjAVF.png" alt="Imgur" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/46520</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46520</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 23 Aug 2019 15:10:31 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Fri, 23 Aug 2019 12:22:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a></p>
<p dir="auto">:-D I constantly keep forgetting this, yes, it should be editor, thx for the head up.</p>
<pre><code>editor.rereplace("-*\d+\.\d{4,}", lambda m: '{:0.3f}'.format(round(float(m.group(0)), 3)))
</code></pre>
<p dir="auto">Yes, to me it looks awkward too but as you said, it might be in the interested of the OP.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46517</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46517</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Fri, 23 Aug 2019 12:22:30 GMT</pubDate></item><item><title><![CDATA[Reply to Regex] Rounding numbers python script does not run properly on Fri, 23 Aug 2019 12:19:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a></p>
<p dir="auto">Ah.  The <code>.0</code> or <code>.000</code> seems like extra noise to me, but maybe it is required for OP’s need (often wish people would explain their need better).</p>
<p dir="auto">But, very nice one-liner Eko!  It’s a clip-and-saver.</p>
<p dir="auto">A switch from <code>editor</code> to <code>editor1</code> ?  Methinks you might be too focused on which view is active.  I pretty much ignore <code>editor1</code> and <code>editor2</code> in my programming unless I <em>really</em> need them. :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/46516</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/46516</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 23 Aug 2019 12:19:19 GMT</pubDate></item></channel></rss>